lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


On 09/16/2017 10:16 PM, Sean Conner wrote:
>   Your job, should you choose to accept it, is to figure out the semantics
> of a Lua directory iterator.
> 
>   -spc
> 

I'm not affiliated with LuaFileSystem project but have implemented something
similar for my own needs.
(https://github.com/martin-eden/workshop/blob/master/mechs/file_lister/get_files_list.lua)

This is two functions with same interface. Given directory name, one returns
sequence with file names, other - sequence with directory names.

They are implemented as running command like "find <dir_name> -maxdepth 1 -type
f" and processing output. So touching OS APIs may be avoided.

-- Martin