lua-users home
lua-l archive

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


Don't use FAT :)

Andre Carregal wrote:
On 5/11/07, Shmuel Zeigerman <shmuz@actcom.co.il> wrote:
Andre Carregal wrote:
> I have no access to a FAT32 system, but I'll try to check this too.

Since it doesn't work on FAT12 either, it can be reproduced as follows
(assuming a floppy drive is available):

1. Format a floppy disk under Windows (right click on A:
    in My Computer, then choose "Format")
2. Create directory A:\tmp
3. Copy test.lua to A:\
4. Run lua A:\test.lua

The first bug reported (the need of /tmp) has been corrected and is
available on lfs CVS HEAD.

A subtle timing bug was also found during the test.lua review and has
been corrected too, so the tests now run on NTFS network drives.

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)

André