How to preserve file-create-timestamp while copying files on OS X from command-line?

4

1

On OS X when you a copy a file using Finder, the target file has the same creation and modification times as the source file.

However when you do so using cp in Terminal both creation and modification times of the target are set to the time of copying. cp -p preserves modification time but not creation time - it is set to the value of the modification time.

Any one know of a command line tool in macs to accomplish the same behavior like in Finder when copying files?

0cd

Posted 2013-06-07T10:43:11.743

Reputation: 339

Answers

2

Look at ditto(1).   

Spiff

Posted 2013-06-07T10:43:11.743

Reputation: 84 656

1As far as I know, "ditto" suffers from the same defect. – Nicolas Barbulesco – 2014-09-03T08:25:08.270