I'm interested in combining the files from three Macs by copying the files from each one into a single folder hierarchy of my design on an external hard drive.
In my past experience copying files in OSX, sometimes the files lose their Created and Modified timestamps; i.e. they are changed to the present moment when the file copy happens.
How can I make sure this doesn't happen?
Best Answer
I just ran across this myself, and the built in
cp
command actually handles it.I discovered a bunch of old CF cards that I wanted to harvest the pictures from. My processing scripts will look at the file mtime to put it in the correct place so I needed it preserved.
From the man page:
So, using
zsh
I was able to run (NO NAME
being my cards volume name):I believe that the special
/**/*
construct is specific to ZSH; however you could do something like