lua-users home
lua-l archive

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


On 5/17/07, Peter Odding <xolox@home.nl> wrote:
Andre Carregal wrote:
> 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. 

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?).

You were right, the times were different and the solution was to force hour = 0. Now the tests run both on NTFS and FAT12.

The new test.lua is already in CVS and will be available in the next LuaFileSystem release. Meanwhile, if someone has access to FAT32, I'd like to know if the tests also pass on such systems.

Shmuel, thanks for pointing out the bugs on the test script and for the FAT12 hint.

André