lunarmodules / luafilesystem

LuaFileSystem is a Lua library developed to complement the set of functions related to file systems offered by the standard Lua distribution.
https://lunarmodules.github.io/luafilesystem/
MIT License
900 stars 291 forks source link

Proposal: Add a filter parameter to 'dir' #134

Open Pharap opened 4 years ago

Pharap commented 4 years ago

If dir accepted a filter parameter (a predicate function) then it would be easier to filter out specific file types (e.g. files with a mode of 'file', files created in the last N days) without having to resort to additional nesting within the generic for.

(One particularly notable use of such a feature would be to filter out '..' and '.' as they often aren't relevant.)