How to copy files correctly?

Discussion in 'Web Design and Development' started by DesertFox, Jul 10, 2006.

  1. DesertFox macrumors member

    Nov 25, 2004

    Im running a CMS on localhost and it needs an update. I would like finder to copy folders with files so that it wont delete everything in the target folder and only copy over the new file. Basically here is what is happening right now:

    Before copy:
    Source folder contains new file 1, new file 2

    Target folder contains file 1, file 2, file 3, file 4

    After copy:
    Target folder contains: new file 1, new file 2

    So, as you can see...file 3 and file 4 are gone (this will break the web app).

    I copy maybe hundredds of folder with new files so doing all this by hand wouldnt make much sense.

    Is there anyone out there with a similar issue that has found a solution?

    Thanks in advance.
  2. EricNau Moderator emeritus


    Apr 27, 2005
    San Francisco, CA
    Could you delete the original folder, and then upload the new one?
  3. littlejim Guest

    You'll probably be looking to use cp -R in the terminal.

    Something like :

    cp -R source/ target/

    But please experiment before you take my word for it (and try typing 'man cp' before you proceed!).
  4. DesertFox thread starter macrumors member

    Nov 25, 2004
    Found the solution

    Had to use the ditto command in the terminal.

Share This Page