Hi, Andy Wingo <[email protected]> skribis:
> On Tue 30 Aug 2011 18:06, [email protected] (Ludovic Courtès) writes: > >> I was actually planning to push ‘file-system-fold’, a functional >> alternative to ‘ftw’, which would be along the lines of this (from >> <http://git.savannah.gnu.org/cgit/libchop.git/tree/utils/chop-backup#n46>): >> >> (define (file-system-fold enter? leaf down up skip init file-name) >> "Traverse the directory at FILE-NAME, recursively. Enter sub-directories >> only when (ENTER? PATH STAT RESULT) returns true. When a sub-directory is >> entered, call (DOWN PATH STAT RESULT), where PATH is the path of the >> sub-directory and STAT the result of (lstat PATH); when it is left, call >> (UP >> PATH STAT RESULT). For each file in a directory, call (LEAF PATH STAT >> RESULT). Return the result of these successive applications. When ENTER? >> returns no, call (SKIP PATH STAT RESULT)." >> >> ...) > > I see that you haven't pushed this yet. Want to do so? Yes, I’m looking into this now. I was planning to make it part of (ice-9 ftw); WDYT? If there’s anything else you’d like to discuss about the API or implementation, please let me know. > I would be happy with a `scandir' implementation on top of this > interface. Yes. The mixture of concerns in that function is not brilliant, but OTOH it’s probably good to have a function people are familiar with. Thanks, Ludo’.
