From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: ludo@gnu.org (Ludovic =?iso-8859-1?Q?Court=E8s?=) Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add "scandir" procedure Date: Sat, 10 Dec 2011 15:52:46 +0100 Message-ID: <87liqkh41t.fsf@gnu.org> References: <1314475521.3143.47.camel@Renee-desktop> <8762lehoj4.fsf@gnu.org> <87k469or31.fsf@pobox.com> NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: dough.gmane.org 1323528783 16385 80.91.229.12 (10 Dec 2011 14:53:03 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2011 14:53:03 +0000 (UTC) Cc: guile-devel@gnu.org To: Andy Wingo Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 10 15:52:59 2011 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([140.186.70.17]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1RZOIK-0003oZ-Qd for guile-devel@m.gmane.org; Sat, 10 Dec 2011 15:52:56 +0100 Original-Received: from localhost ([::1]:46532 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOIK-0005iD-FP for guile-devel@m.gmane.org; Sat, 10 Dec 2011 09:52:56 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:35060) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOII-0005hx-6R for guile-devel@gnu.org; Sat, 10 Dec 2011 09:52:55 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZOIG-0004OU-W6 for guile-devel@gnu.org; Sat, 10 Dec 2011 09:52:54 -0500 Original-Received: from mail4-relais-sop.national.inria.fr ([192.134.164.105]:17528) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOIG-0004ON-OU for guile-devel@gnu.org; Sat, 10 Dec 2011 09:52:52 -0500 X-IronPort-AV: E=Sophos;i="4.71,331,1320620400"; d="scan'208";a="122851638" Original-Received: from reverse-83.fdn.fr (HELO pluto) ([80.67.176.83]) by mail4-relais-sop.national.inria.fr with ESMTP/TLS/DHE-RSA-AES128-SHA; 10 Dec 2011 15:52:50 +0100 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 20 Frimaire an 220 de la =?iso-8859-1?Q?R=E9volution?= X-PGP-Key-ID: 0xEA52ECF4 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 83C4 F8E5 10A3 3B4C 5BEA D15D 77DD 95E2 EA52 ECF4 X-OS: x86_64-unknown-linux-gnu In-Reply-To: <87k469or31.fsf@pobox.com> (Andy Wingo's message of "Tue, 06 Dec 2011 12:52:02 +0100") User-Agent: Gnus/5.110018 (No Gnus v0.18) Emacs/24.0.90 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 192.134.164.105 X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:13030 Archived-At: Hi, Andy Wingo skribis: > On Tue 30 Aug 2011 18:06, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > >> I was actually planning to push =E2=80=98file-system-fold=E2=80=99, a fu= nctional >> alternative to =E2=80=98ftw=E2=80=99, 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-direct= ories >> only when (ENTER? PATH STAT RESULT) returns true. When a sub-director= y 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, ca= ll (UP >> PATH STAT RESULT). For each file in a directory, call (LEAF PATH STAT >> RESULT). Return the result of these successive applications. When EN= TER? >> returns no, call (SKIP PATH STAT RESULT)." >> >> ...) > > I see that you haven't pushed this yet. Want to do so? Yes, I=E2=80=99m looking into this now. I was planning to make it part of (ice-9 ftw); WDYT? If there=E2=80=99s anything else you=E2=80=99d like to discuss about the AP= I 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=E2=80=99s probably good to have a function people are familiar with. Thanks, Ludo=E2=80=99.