From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: [PATCH] Add "scandir" procedure Date: Sat, 10 Dec 2011 16:37:44 +0100 Message-ID: <87mxb0igjb.fsf@pobox.com> References: <1314475521.3143.47.camel@Renee-desktop> <8762lehoj4.fsf@gnu.org> <87k469or31.fsf@pobox.com> <87liqkh41t.fsf@gnu.org> 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 1323531504 788 80.91.229.12 (10 Dec 2011 15:38:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 10 Dec 2011 15:38:24 +0000 (UTC) Cc: guile-devel@gnu.org To: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Dec 10 16:38:06 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 1RZOzr-00085o-JZ for guile-devel@m.gmane.org; Sat, 10 Dec 2011 16:37:59 +0100 Original-Received: from localhost ([::1]:38314 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOzq-0000wp-T1 for guile-devel@m.gmane.org; Sat, 10 Dec 2011 10:37:54 -0500 Original-Received: from eggs.gnu.org ([140.186.70.92]:46729) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOzo-0000wY-8V for guile-devel@gnu.org; Sat, 10 Dec 2011 10:37:53 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1RZOzm-0001vK-TG for guile-devel@gnu.org; Sat, 10 Dec 2011 10:37:52 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([74.115.168.62]:47766 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1RZOzm-0001v3-Qp; Sat, 10 Dec 2011 10:37:50 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 5C60D84DB; Sat, 10 Dec 2011 10:37:49 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=sasl; bh=qjGWYHttP1NO Y/w7OkLw4Uh3VAc=; b=NwOL5pKqL9YmboiD9HdtK+pfstU1+GV8tBF6HsS4eEi5 9vNBCx/RtYYRJdXtRMdCNze3rasm0+tHln0W8YLRLT4JmJl3os/yrx0gev7j52b3 4HU5t4MBHuTjqR4DPMQ7GtOVNIpI+OVeAMGx+TrHtjjFjZd3H5LhwihkOpcBNYE= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; q=dns; s=sasl; b=jGhnpI PgMe2kVr6r1iqeLVpvjRHsoQMwmfA9ibcERAlqyj3FY0vcQ9RUpw6GSdgJCBDp1I V0A3HLBSVNrzJoLNbylHyMkHy3M14PV6XyeL7zbIdLTfU5Uo4D+HR4UixkBSq+hM 7NO+15HH09yIqm43D+njLQkvev7GHrfPoPxbE= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 55C0E84DA; Sat, 10 Dec 2011 10:37:49 -0500 (EST) Original-Received: from badger (unknown [90.164.198.39]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 9C75A84D9; Sat, 10 Dec 2011 10:37:48 -0500 (EST) In-Reply-To: <87liqkh41t.fsf@gnu.org> ("Ludovic =?utf-8?Q?Court=C3=A8s=22'?= =?utf-8?Q?s?= message of "Sat, 10 Dec 2011 15:52:46 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.3 (gnu/linux) X-Pobox-Relay-ID: E9F86054-2344-11E1-B581-65B1DE995924-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-Received-From: 74.115.168.62 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:13031 Archived-At: Heya, On Sat 10 Dec 2011 15:52, ludo@gnu.org (Ludovic Court=C3=A8s) writes: > 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 f= unctional >>> 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-direc= tories >>> only when (ENTER? PATH STAT RESULT) returns true. When a sub-directo= ry 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, c= all (UP >>> PATH STAT RESULT). For each file in a directory, call (LEAF PATH STAT >>> RESULT). Return the result of these successive applications. When E= NTER? >>> 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? Sounds fine to me. I didn't take a close look at the implementation, but the idea of the function sounded sane to me. >> 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 wi= th. Yeah, I have the same thoughts. OTOH, if file-system-fold goes into (ice-9 ftw), where would a `scandir' go? There also? I guess that's OK. Just thinking out loud :) Happy hacking, Andy --=20 http://wingolog.org/