Re: Change a file date (creation and modification)
Re: Change a file date (creation and modification)
- Subject: Re: Change a file date (creation and modification)
- From: Matt Deatherage <email@hidden>
- Date: Sun, 13 Feb 2011 12:24:49 -0600
On Feb 13, 2011, at 4:53 AM, KOENIG Yvan <email@hidden> wrote:
> I must say thank you because what surprised you give us a fine tip to change a creation date which may be useful in some cases.
I feel obliged to point out that at the OS level (Carbon/Cocoa/POSIX), you can always change the creation date of a file, as it is just a piece of metadata like any other -- modification date, filename, or even creator type or file type in HFS Plus data. This is how all archiving programs work: when you unzip or unstuff something, the files inside get their original creation/modification dates, not the date/time when you decompressed the archive and recreated the original files. Same with backup utilities, etc.
The many people here who are fond of "do shell script" could probably come up with a one-liner that will accomplish the task. If not, a scripting addition or scriptable application certainly can do it.
The only difference between timestamps is that, if not otherwise set, the OS automatically sets them to the date/time a file was created, and changes the modification time to the current time when a file is written to. Programs don't *have* to do those things themselves for the timestamps to have their normal values, but programs certainly can change the values to whatever they want. Finder normally disallows this, I would imagine, to keep casual scripters from causing or getting into trouble, but the OS level has always allowed this. Most file transfer programs can't work any other way.
--Matt
Sent from my iPad
_______________________________________________
Do not post admin requests to the list. They will be ignored.
AppleScript-Users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
Archives: http://lists.apple.com/archives/applescript-users
This email sent to email@hidden