Re: getting file creation date from NTFS
Re: getting file creation date from NTFS
- Subject: Re: getting file creation date from NTFS
- From: Alastair Houghton <email@hidden>
- Date: Sun, 23 May 2010 22:07:47 +0100
On 23 May 2010, at 21:21, Paul Sanders wrote:
>> On sensible platforms, stat() returns UTC, as you'd expect.
>
> That statement I can now verify by experiment (which is good as I assumed that when I wrote the code). The docs do not say.
OS X conforms to the SUSv3 specification, which says explicitly in the documentation for <sys/stat.h>:
"Times shall be given in seconds since the Epoch."
The docs don't really *have to* say, though, because it's the only choice that makes any sense. The behaviour on Windows is obviously wrong---imagine what might happen if you read a time from the filesystem, then the user changes the time zone, *then* you convert it from local time to UTC, but using the *wrong* local time! You can't even remember which time zone you were in before reading the time, because the user could change it between you remembering it and you reading the time.
Kind regards,
Alastair.
--
http://alastairs-place.net
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden