diff options
author | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
---|---|---|
committer | Bryan Newbold <bnewbold@robocracy.org> | 2017-02-20 00:06:40 -0800 |
commit | a69c9fb665459e2bfdbda1bf80741a0af31a7faf (patch) | |
tree | f0bc974f8805049e6b9a4e6864886298fbaa05a4 /dirs.scm | |
parent | 4684239efa63dc1b2c1cbe37ef7d3062029f5532 (diff) | |
download | slib-upstream/3b5.tar.gz slib-upstream/3b5.zip |
New upstream version 3b5upstream/3b5upstream
Diffstat (limited to 'dirs.scm')
-rwxr-xr-x[-rw-r--r--] | dirs.scm | 17 |
1 files changed, 17 insertions, 0 deletions
@@ -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))) |