lua-users home
lua-l archive

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


I find lfs so generally useful/necessary that I always build it into my
lua binary so it's "just there."

I would be most grateful if the standard distro could be updated (I'd
call it fixed, as you can consider this a bug IMO :-) so that the mode
field returned by lfs.attributes() is a table of strings, not just a
single string. (For backward compatibility, perhaps another field could
be added to the table for this additional data.)

It's not possible (that I can see) with lfs to enumerate all links in
a file system -- because any symlink to a directory is always identified
as "directory", and never as "link". (The mode2string function returns
as soon as it sees S_ISDIR() is true, and this is tested before S_ISLNK().
Changing the order of operations in the function would change but not fix
this issue.)

In particular, this makes lfs.dir() impossible [?] to use safely for
recursively scanning a directory tree -- you can't implement an option 
not to follow symlinked subtrees because you can't identify them...