Re: Outstanding issue: directory-files in the context of huge directories
Lassi Kortela 04 Sep 2019 12:26 UTC
> It's a wrapper of POSIX readdir, which with the one for opendir per
> your observations of their use in the field never returns "." and
> "..", and has an optional argument if you want any other dot files.
read-directory doesn't have to be a straight wrapper for readdir(). It
can do its own buffering. Though AFAIK all implementations of readdir()
also buffers getdirentries() or getdents() results from the kernel, so
it's not clear whether buffering them again in Scheme makes sense. Maybe
the best would be for Scheme to call getdirentries(), bypassing
readdir(), provided the syscall interface is easy to access.
> But we're working on a generator to add to the SRFI.
In the current draft, read-directory already returns names one by one,
then (eof-object) at the end. That matches the SRFI 158 definition of a
generator unless I misunderstood something.
Are you talking about the
generator-that-returns-sublists-of-the-full-list that we discussed much
earlier?