Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

macstatic

macrumors 68020
Original poster
Oct 21, 2005
2,025
165
Norway
Is there an OSX terminal command (or one that can be installed) which allows for writing OSX file-system attributes such as the file "Creation" date (possibly also the modification date)?
I'd like to use it in conjunction with Exiftool (for modifying file and EXIF attributes of image files) but alas it won't write the file Creation date, and apparently neither will the command xattr.
 
Last edited:
Nice!
Could it be used together with Exiftool and have it determine the new creation date? I'm guessing as a variable though I know very little about programming.
 
Nice!
Could it be used together with Exiftool and have it determine the new creation date? I'm guessing as a variable though I know very little about programming.

Yes you can set that if you wish to using it. I take it you want to process the file(s) with the Exiftool then set the creation date back to the original date then once done? If so should be rather easy to do a simple bash script to read the original date store that as variable then process file(s) once done write the correct original date back to the file. According to the page below stat -f%SB -t %Y%m%d%H%M file will do it for the ctime so that read into a variable can be used to touch the ctime on the processed file at the end of processing. There are other methods shown in that answer near the bottom of the page.

https://unix.stackexchange.com/questions/91197/how-to-find-creation-date-of-file
 
Yes, I want Exiftool to locate the correct date (by reading it from the photo's EXIF header), then use another tool (touch?) to actually write that date into the file "Creation" attribute.
According to the author, Exiftool uses "mdls" which doesn't have write abilities and therefore can't write OSX file-system attributes. This is what I'm trying to find a different tool for.

Thanks for the link and your script suggestion. I'll see what I can make out of it.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.