[erlang-questions] File creation times under Windows

Dave Smith dave.smith.to@REDACTED
Mon Oct 27 21:56:40 CET 2008


NTFS stores time properly in UTC.  FAT/FAT32 stores in local time. Either
way, time should be displayed in local time when file:read_file_info/1 is
called.

I did a little digging into the driver code an to appears the the
FileTimeToLocalTime Win32API to convert the time.  I suspect it is this API
call that is the root of the problem.  I don't have a Windows platform to
test on, so I can't dig any further, but there is a discussion
here<http://www.codeproject.com/KB/datetime/dstbugs.aspx>that might
explain the problem more.



2008/10/27 Johnny Billquist <bqt@REDACTED>

> John Hughes wrote:
> > I would have expected that, once a file has been created, then its
> creation
> > time should remain constant (unless explicitly modified)--wouldn't you?
> Not
> > so! At least, not under Windows. Under both XP and Vista, the file
> creation
> > time reported by file:read_file_info changes by an hour when daylight
> saving
> > time ends (and presumably also when it begins)!
> >
> > File system design according to the Principle of Greatest Astonishment,
> > evidently.
>
> I believe that's a basic problem with windows, since it don't actually
> keep time in UTC, but local time, internally.
>
> In short: if you use Windows, that's the way it is. Don't have anything
> to do with Erlang.
>
>        Johnny
>
> _______________________________________________
> erlang-questions mailing list
> erlang-questions@REDACTED
> http://www.erlang.org/mailman/listinfo/erlang-questions
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://erlang.org/pipermail/erlang-questions/attachments/20081027/d28078f7/attachment.htm>


More information about the erlang-questions mailing list