Thanks.
Setfile is an option, but one I've put aside since it involves signing in and downloading the huge Xcode package, but reconsidering it after reading your reply I found info on
how to install the OSX command line tools without installing all of Xcode. In short, just enter the following terminal command:
$
xcode-select --install
By the way, does anyone know how to download the above
and keep the installation package?
UPDATE:
having read this I found out I could sign in with my Apple ID to
'downloads for Apple developers' where I found
Command line tools for OSX 10.9 for Xcode 6.1.dmg (if I'm not mistaken that's the latest one for OSX 10.9 Mavericks -please correct me if I'm wrong).
Anyway, I tried
setfile and indeed, it does allow changing the OSX file creation date (and unlike
touch (which changes both creation and modification dates at once) it allows changing only the creation date). For instance to February 28th 2016, 13:21:59 (1:21:59 pm):
$
setfile -d "02/28/2016 13:21:59" FILENAME.PNG
The downside is the rather strange date format which I'm guessing would take some clever programming to work with other tools.
As for touch, I don't know what I did wrong -I must have missed a digit or two when I tried it out. The following example works fine, which sets both creation and modification dates to January 31st 2016, 22:14:33 (10:14:33 pm):
$
touch -t "201501312214.33" FILENAME.PNG
It only allows the
creation date to be changed to something
earlier than the current
modification date. If that's the case then both
creation and modification dates are changed to that date.
If the entered date is
later than the current modification date,
then only the modification date is changed.
Actually, despite the above limitations this works fine in my case (now that I've gotten
touch to work!) as I would only need to change the dates to something earlier than the modification date anyway, but it's nice to see I have options
In any case (writing the creation date from image files' EXIF tags) I need to create an Automator script which reads the
[XMP-exif]DateTimeOriginal (EXIF) tag and write that date/time information (using
touch or
setfile) to the file's creation date. I'm guessing I would have
EXIFtool read the DateTimeOriginal EXIF tag, output it as a variable which would be passed on to the touch or setfile command. Being a novice in the programming department, how would I actually do this?
[doublepost=1461527271][/doublepost]
You can get any older version of 'touch' from Apple's Open Source website:
http://opensource.apple.com//
It's located under "file-cmds", e.g.:
http://opensource.apple.com/source/file_cmds/file_cmds-220.7/
You can also get an older version and the current version, diff them, and see what differences there are.
Much appreciated! I didn't know about that site which could be useful for other stuff as well (hoping it would answer my question above about how do download the Xcode command line tools on their own, but it appears not to contain them).
Worst case, you'll have to compile an older version of touch and deploy it locally (or in a sub-dir of an app).
Interesting thought. Are you saying I could somehow create an Automator script and create a self-contained app with (that older version of) the
touch command? That would certainly make it a lot easier to share with others.