|
| LuaFileSystem Reference Manual |
| File system library for the Lua programming language |
LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.
LuaFileSystem is free software and uses the same license as Lua 5.0.
LuaFileSystem offers the following functions:
nil plus an error string. mode could be either
r (for a read/shared lock) or w (for a
write/exclusive lock). The optional arguments start
and length can be used to specify a starting point and
its length; both should be numbers.false plus an error string.
start and
length can be used to specify a starting point and its
length; both should be numbers.false plus a string
describing the error.
require"lfs"
function attrdir (path)
for file in lfs.dir(path) do
if file ~= "." and file ~= ".." then
local f = path..'/'..file
print ("\t "..f)
local attr = lfs.attributes (f)
assert (type(attr) == "table")
if attr.mode == "directory" then
attrdir (f)
else
for name, value in pairs(attr) do
print (name, value)
end
end
end
end
end
attrdir (".")