Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- function flib.getOS()
- return (os.getenv("HOME") == nil and "windows" or "unix")
- end
- function flib.getFiles(directory)
- if fs ~= nil then
- return fs.list(directory)
- else
- local i, t, popen = 0, {}, io.popen
- for filename in popen((flib.getOS() == "unix" and ('ls -a "' .. directory .. '"') or ('dir "' .. directory .. '" /b /ad'))):lines() do -- LINE 205
- i = i + 1
- t[i] = filename
- end
- return t
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment