From: John Cowan <xxxxxx@ccil.org>
Date: Tuesday, July 30, 2019 1:52 PM

On Mon, Jul 29, 2019 at 1:42 PM Lassi Kortela <xxxxxx@lassi.io> wrote:

- I would always leave out dot and dot-dot from the results

+1, even for the low-level open/read/close.  If you want . and .. it's easy to add them by hand.
 
However, sometimes you want [dot files].

Hence the flag.
 
[...]

I just commited a change to the SRFI incorporating all of the above, and changing the description to match the signature, read-directory returns a #f instead of an end-of-file object when it runs out of files:

(open-directory dir [dot-files?])     →     directory-object         (procedure) 
(read-directory directory-object)     →     string or #f         (procedure) 
(close-directory directory-object)     →     undefined         (procedure) 

These functions implement an interface to the opendir()/ readdir()/ closedir() family of functions for processing directories.

The open-directory procedure opens the directory with the specified pathname for reading, returning an opaque directory object. Then read-directory returns the name of the next available file, or #f if there are no more files. The dot-files? argument controls whether file names beginning with "." are returned. If it is #f, which is the default, they are not. The file names . and .. are never returned. Finally, close-directory closes a directory object.


- Harold