lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Andre Carregal wrote:
But the second bug reported, related to lfs.touch on FAT systems,
turned out to be more bizarre than expected. When executing

local testdate = os.time({ year = 2007, day = 10, month = 2})
assert (lfs.touch (tmpfile, testdate))
local new_att = assert (lfs.attributes (tmpfile))
assert (new_att.access == testdate, "could not set access time")

on a FAT 12 system, it fails on the assert with a "could not set
access time" error.

Apparently FAT 12 and FAT32 are not very easy on the time handling side
(http://en.wikipedia.org/wiki/File_Allocation_Table#Directory_table)
and it seems that Python has passed by problems like that (tks Mascarenhas):
http://mail.python.org/pipermail/python-bugs-list/2004-November/025966.html

Does anyone know what may be happening or how to get over this?
Mentions to "not using Windows" may be spared please. :o)

Have you compared the values, i.e. are they within a certain range? Access time seems to have a resolution of one day, so the sample code *should* work. However it could still be losing some precision, though I wouldn't know why (timezone?).

 - Peter Odding