CP or Ditto?

Discussion in 'macOS' started by ///alpinepower, Jan 19, 2010.

  1. ///alpinepower macrumors member

    Joined:
    Aug 13, 2007
    #1
    what is the difference between cp and ditto and other file copy commands?
     
  2. larkost macrumors 6502a

    Joined:
    Oct 13, 2007
    #2
    It used to be that ditto was the only thing that would copy resource forks and the like, but nowadays cp does this as well (at least on MacOS X). So mostly the reasons for using it are historical.

    The only reason I can think of for using it nowadays is that you can tell it to only copy the code segments for a single executable type (like PPC, i386, or x86_64). That would make things a little smaller (not really much), or force a program to run in a given mode (ie: 32bit, or rosetta).

    Oh, and it can "copy" things in to or out of CPIO (the compression that pkg's use) or PKZip formats, or a couple other tricks you can pull around packages.
     
  3. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #3
    At one point you had to use ditto so that the copy operation would include the resource fork. Now cp AFAIK includes the resource for so it becomes more of a personal preference (I use cp)
     
  4. enberg macrumors regular

    Joined:
    Jan 13, 2010
    #4
    It's probably better to get in the habit of using CP. If you ever end up in front of another unix, ditto won't be available.
     
  5. maflynn Moderator

    maflynn

    Staff Member

    Joined:
    May 3, 2009
    Location:
    Boston
    #5
    Or Linux for that matter ;)
     
  6. ///alpinepower thread starter macrumors member

    Joined:
    Aug 13, 2007
    #6
    Thanks - I had always used cp, but the 'genius' bar guy replacing a hard drive on my wife's computer had some preference for ditto that he could not explain to me...... :confused:
     

Share This Page