2 ms·
Lua does have file system access: http://www.lua.org/manual/5.2/manual.html#6.8 http://www.lua.org/manual/5.2/manual.html#6.8
by kodablah 13y ago
Lua does have file system access: http://www.lua.org/manual/5.2/manual.html#6.8 http://www.lua.org/manual/5.2/manual.html#6.8
- spc476 13y agoIn that it can open files. It does not, however, have a way to enumerate files in a given directory---that requires a module to handle.
- kodablah 13y agoAh, true. Penlight helps, but you are correct it is a separate module. I think for being the target of a higher-level language it might help that you aren't married to a standard library.
- jekub 13y agoI fully agree with you but just want to add that you can do it in "pure" Lua : for file in io.popen("ls "..dir):lines() do ... end This should never be used in real applications and a proper filesystem module should be used instead. But, I find it very useful for quick one-shot scripts I write for batch processing some files.