答案 0 :(得分:3)
帮自己一个忙,并使用LuaFileSystem ......
如果你在Windows上并且想要以艰难的方式去做,你基本上只是使用io.popen()调用“dir”并解析你得到的值。
local f = io.popen("dir \"C:\\users\\\"")
if f then
print(f:read("*a"))
else
print("failed to read")
end
将转储C:\ users目录中的所有内容(包括。和..)。然后你必须编写一个函数来解析文件/目录并将它们形成为格式良好的路径。