This proposal depends on SettingsListsCowan. See DirectoriesCowan for a proposal for creating and destroying directories.
(open-directory filename)
Filename can be a string or a settings list as described in SettingsListsCowan. In addition to the keys path and encoding specified there, the key hidden can have the values none (don't expose hidden files), all (expose all files), and dots (expose all files except . and ..). On Posix systems, hidden files have names beginning with .; on Windows, hidden files are named ., .., or have the hidden file attribute.
The returned value is an input port, but it is neither a binary port nor a character port. The only standard procedure callable on it is read, which returns the next available filename as a string (or, when necessary, an implementation-dependent object). Filenames are returned in arbitrary order.
(directory-port? obj)
Returns #t if obj is a directory port. Directory ports are a disjoint type.