l = file.list()
str = ""
if l == nil then
str = "{\"files\":null}"
else
str = "{\"files\":["
for k,v in pairs(l) do
str = str .. "{\"name\":\"" .. k .. "\", \"size\":" .. v .. "}, "
end
str = string.sub(str, 0, string.len(str) - 2)
str = str .. "]}"
end
print(str)
str = nil
l = nil
No comments:
Post a Comment