Closed xuzhen closed 4 years ago
@xuzhen Yes, this is a limitation of Lua 5.3. This does not happen on Lua 5.4 because there is explicit support for closing resources in the for
loop. In Lua 5.3, the workaround is to call lfs.dir
in a separate line to get the dir_obj
and close it yourself.
related commit: https://github.com/keplerproject/luafilesystem/commit/842505b6a33d0b0e2445568ea42f2adbf3c4eb77