make it possible for the procedure in fold-files to signal skipping a directory

svn: r3695
This commit is contained in:
Eli Barzilay 2006-07-13 09:56:06 +00:00
parent c766cf9f8e
commit 38d5a59a3c

View File

@ -478,9 +478,13 @@
(define (do-path path acc)
(cond [(and (not follow-links?) (link-exists? path)) (f path 'link acc)]
[(directory-exists? path)
(do-paths (map (lambda (p) (build-path path p))
(directory-list path))
(f path 'dir acc))]
(call-with-values (lambda () (f path 'dir acc))
(lambda (acc . descend?)
(if (if (pair? descend?) (car descend?) #t)
(do-paths (map (lambda (p) (build-path path p))
(directory-list path))
acc)
acc)))]
[(file-exists? path) (f path 'file acc)]
[(link-exists? path) (f path 'link acc)] ; dangling links
[else (error 'fold-files "path disappeared: ~e" path)]))