local lfs = 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

local path = "."
if arg[1] and arg[1] ~= "" then
    path = arg[1]
end

attrdir (path)

Test luafilesystem to get file attribute
Test luafilesystem to get file attribute

Signed-off-by: Robbie Cao <643a933cab46d49aae0d64e790867eaec8b68831@gmail.com>
