Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Copy new files on old files in same folder

Copy new files on old files in same folder

Scheduled Pinned Locked Moved C / C++ / MFC
helptutorial
7 Posts 6 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    neha agarwal27
    wrote on last edited by
    #1

    Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

    R R D E H 6 Replies Last reply
    0
    • N neha agarwal27

      Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

      R Offline
      R Offline
      Rajesh R Subramanian
      wrote on last edited by
      #2

      You want to replace an existing file with a new one? If yes, show the code that you have written to do the same.

      Nobody can give you wiser advice than yourself. - Cicero .·´¯`·->Rajesh<-·´¯`·. Codeproject.com: Visual C++ MVP

      1 Reply Last reply
      0
      • N neha agarwal27

        Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

        R Offline
        R Offline
        rp_suman
        wrote on last edited by
        #3

        Hi, If you are using CreateFile Function[^]Windows API to create the file, then set the 5th parameter(dwCreationDisposition) as OPEN_ALWAYS to create the new file always. If it is some other function, there will be a flag for setting file creation mode. Another way is to find the files by using CFileFind functions, delete them by DeleteFile() then create new files. Post code if you have problem still. Thanks, Suman

        -- "Programming is an art that fights back!"

        modified on Friday, April 4, 2008 8:37 AM

        1 Reply Last reply
        0
        • N neha agarwal27

          Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

          D Offline
          D Offline
          David Crow
          wrote on last edited by
          #4

          neha.agarwal27 wrote:

          ...if folder is existing at that place then a new copy is been created with same name...

          This is not possible.

          neha.agarwal27 wrote:

          ...what i want is to copy new files on previous files....

          Do you mean overwriting?

          "Love people and use things, not love things and use people." - Unknown

          "To have a respect for ourselves guides our morals; to have deference for others governs our manners." - Laurence Sterne

          1 Reply Last reply
          0
          • N neha agarwal27

            Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

            R Offline
            R Offline
            rp_suman
            wrote on last edited by
            #5

            neha.agarwal27 wrote:

            new copy is been created with same name and having same file in previous folder only

            Folder with same name is not possible, Do you mean, the file with same name is created like "Copy of File1" if there is "File1" already or something like that? Thanks, Suman

            -- "Programming is an art that fights back!"

            1 Reply Last reply
            0
            • N neha agarwal27

              Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

              E Offline
              E Offline
              Eytukan
              wrote on last edited by
              #6

              neha.agarwal27 wrote:

              My problem is if folder is existing at that place then a new copy is been created with same name

              What the heck? How can it create two folders with the same name?


              OK,. what country just started work for the day ? The ASP.NET forum is flooded with retarded questions. -Christian Graus Best wishes to Rexx[^]

              1 Reply Last reply
              0
              • N neha agarwal27

                Hi all, I am having a folder and in that folder i am having some file... Now i have written a code which makes this folder and write files in this particular folder..... My problem is if folder is existing at that place then a new copy is been created with same name and having same file in previous folder only, where as what i want is to copy new files on previous files.... How to achieve this.... Can anybody please help me in this Thanks in advance

                H Offline
                H Offline
                Hamid Taebi
                wrote on last edited by
                #7

                You cant make same folder on that folder but you can use of some character with our name.

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups