第1个回答 推荐于2016-07-10
local lfs = require"lfs"
function attrdir (path)
for file in lfs.dir(path) do
if file ~= "." and file ~= ".." then
local f = path..'/'..file
local attr = lfs.attributes (f)
assert (type(attr) == "table")
if attr.mode == "directory" then
print(f)
end
end
end
end
attrdir ("E:\\LUA")本回答被提问者采纳