From a69c9fb665459e2bfdbda1bf80741a0af31a7faf Mon Sep 17 00:00:00 2001 From: Bryan Newbold Date: Mon, 20 Feb 2017 00:06:40 -0800 Subject: New upstream version 3b5 --- dirs.scm | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) mode change 100644 => 100755 dirs.scm (limited to 'dirs.scm') diff --git a/dirs.scm b/dirs.scm old mode 100644 new mode 100755 index 15d1ffd..0d1212d --- a/dirs.scm +++ b/dirs.scm @@ -96,3 +96,20 @@ (do ((filename (read-line port) (read-line port))) ((or (eof-object? filename) (equal? "" filename))) (and (selector filename) (proc filename))))))))) + +;;@body +;;@2 is a pathname whose last component is a (wildcard) pattern +;;(@pxref{Filenames, , , slib, SLIB}). +;;@1 must be a procedure taking one argument. +;;@samp{directory*-for-each} applies @var{proc} to the (string) name of +;;each file in the current directory. The dynamic order in which @var{proc} is +;;applied to the filenames is unspecified. The value returned by +;;@samp{directory*-for-each} is unspecified. +(define (directory*-for-each proc path-glob) + (define dir (pathname->vicinity path-glob)) + (let ((glob (substring path-glob + (string-length dir) + (string-length path-glob)))) + (directory-for-each proc + (if (equal? "" dir) "." dir) + glob))) -- cgit v1.2.3