In the Lua reference, it says that search path only returns files that it can open, so I simply used the same mechanic. But for the default case `fs.isDirectory` would work just as well since all files can be opened for reading.