lua-users home
lua-l archive

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


Dear List,
LuaFileSystem (lfs) provides a directory iterator factory lfs.dir that
creates an iterator that opens a given directory and each time it is
called it returns a next directory entry. So far so good. An open
directory will be closed when (A) all the entries were delivered or
(B) when GC collects the corresponding userdata (__gc is provided).

Unfortunately, I do not see how one can close the directory explicitly
from Lua short of hacking lfs.c. The directory related userdata is
well hidden inside an upvalue accessible only to dir_iter.

Am I missing something?

--Leo--