[Top][All Lists]

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

Re: [PATCH] Add "scandir" procedure

From: Ludovic Courtès
Subject: Re: [PATCH] Add "scandir" procedure
Date: Sat, 10 Dec 2011 15:52:46 +0100
User-agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux)


Andy Wingo <address@hidden> skribis:

> 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
>> <>):
>>   (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.


reply via email to

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