guile-devel
[Top][All Lists]
Advanced

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

Re: [PATCH] Add "scandir" procedure


From: Andy Wingo
Subject: Re: [PATCH] Add "scandir" procedure
Date: Tue, 06 Dec 2011 12:52:02 +0100
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux)

On Tue 30 Aug 2011 18:06, address@hidden (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?

I would be happy with a `scandir' implementation on top of this
interface.  We should find a way to push most POSIX things out to a
module, though!

Andy
-- 
http://wingolog.org/



reply via email to

[Prev in Thread] Current Thread [Next in Thread]