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

svn: r3695

original commit: 38d5a59a3cd2c43f89a854cf7a07fe93b58fdd3d
This commit is contained in:
Eli Barzilay 2006-07-13 09:56:06 +00:00
parent 3536d510e7
commit 6edba2f4c6

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)]))