Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- -- Get files from a directory and subfolders (windows)
- local function scandir(path, files)
- local f = io.popen('dir "'..path..'" /b')
- if (not f) then return files end
- for name in f:lines() do
- if (name:find("%.")) then
- table.insert(files, path.."/"..name)
- else
- scandir(path.."/"..name, files)
- end
- end
- f:close()
- return files
- end
- for k,v in ipairs(scandir("lua_scripts", {})) do
- print(k, v)
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement