I'm new to lua.
I've tried to use http://keplerproject.github.io/luafilesystem/examples.html and it throws an error on inaccessible directories.
This appears to be caused by luaL_error https://github.com/keplerproject/luafilesystem/blob/master/src/lfs.c#L563
How can I catch this error?
http://www.tutorialspoint.com/lua/lua_error_handling.htm
suggests pcall
, however that doesn't stop the script from dying:
pcall(lfs.dir('/etc/passwd')) #this fails to handle the not a directory error