unofficial mirror of guile-devel@gnu.org 
 help / color / mirror / Atom feed
From: ludo@gnu.org (Ludovic Courtès)
To: Andy Wingo <wingo@pobox.com>
Cc: guile-devel@gnu.org
Subject: Re: [PATCH] Add "scandir" procedure
Date: Sat, 10 Dec 2011 15:52:46 +0100	[thread overview]
Message-ID: <87liqkh41t.fsf@gnu.org> (raw)
In-Reply-To: <87k469or31.fsf@pobox.com> (Andy Wingo's message of "Tue, 06 Dec 2011 12:52:02 +0100")

Hi,

Andy Wingo <wingo@pobox.com> skribis:

> On Tue 30 Aug 2011 18:06, ludo@gnu.org (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’.



  reply	other threads:[~2011-12-10 14:52 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-08-27 20:05 [PATCH] Add "scandir" procedure nalaginrut
2011-08-30 16:06 ` Ludovic Courtès
2011-09-01  4:46   ` Nala Ginrut
2011-09-01 12:12     ` Ludovic Courtès
2011-09-01 16:05       ` Nala Ginrut
2011-09-01 21:01         ` Ludovic Courtès
     [not found]           ` <CAPjoZof=iV57JP4-HgFjGTbMnaa9ex_QfP17Mn12j3XE3GxPSA@mail.gmail.com>
     [not found]             ` <8739gfuxky.fsf@gnu.org>
2011-09-02 11:38               ` Nala Ginrut
2011-09-02 12:14                 ` Ludovic Courtès
2011-12-06 11:52   ` Andy Wingo
2011-12-10 14:52     ` Ludovic Courtès [this message]
2011-12-10 15:37       ` Andy Wingo
2011-12-10 19:05         ` Ludovic Courtès
2011-12-14  0:21         ` Ludovic Courtès
2012-01-08 15:22           ` Ludovic Courtès
2011-12-18 20:30 ` Ludovic Courtès
2011-12-19 19:20   ` Nala Ginrut
2011-12-19 21:38     ` Ludovic Courtès
2011-12-20  3:23       ` Nala Ginrut
2011-12-20  3:25         ` Nala Ginrut
2011-12-20 12:03           ` Ludovic Courtès
  -- strict thread matches above, loose matches on Subject: below --
2011-08-27 20:18 Nala Ginrut
2011-09-02  1:00 Nala Ginrut

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87liqkh41t.fsf@gnu.org \
    --to=ludo@gnu.org \
    --cc=guile-devel@gnu.org \
    --cc=wingo@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).