How do I set the creation time of a file?
How can you create a files on a Mac that have a specific creation date (different from the current one)?
What I have found so far, touch can only alter the modified at time...
Ask Different is a question and answer site for power users of Apple hardware and software. It only takes a minute to sign up.Sign up to join this community
I believe you can do it with touch.
touch -t YYYYMMDDhhmm /filehere
SetFile can also be used to set the creation date before the modification date or in the future.
-d date Sets the creation date, where date is a string of the form: "mm/dd/[yy]yy [hh:mm:[:ss] [AM | PM]]" Notes: Enclose the string in quotation marks if it contains spa- ces. The date must be in the Unix epoch, that is, between 1/1/1970 and 1/18/2038. If the year is provided as a two- digit year, it is assumed to be in the 21st century and must be from 00 (2000) through 38 (2038).
This would set the creation date to the modification date:
SetFile -d "$(GetFileInfo -m test.txt)" test.txt
SetFile and GetFileInfo are part of the command line tools package, which can be downloaded from developer.apple.com/downloads or from Xcode's preferences after installing it from the App Store.