Handling case where opendir fails in directory-fold-tree.

This commit is contained in:
Alex Shinn 2013-10-03 09:37:33 +09:00
parent 8ddee1f704
commit 3c8c1fe74b

View file

@ -49,6 +49,7 @@
(cond (cond
((file-directory? file) ((file-directory? file)
(let ((d (opendir file))) (let ((d (opendir file)))
(if (not d)
(let lp ((acc acc)) (let lp ((acc acc))
(let ((e (readdir d))) (let ((e (readdir d)))
(cond (cond
@ -59,7 +60,7 @@
(let ((path (string-append file "/" f))) (let ((path (string-append file "/" f)))
(lp (fold path (down path acc))))))) (lp (fold path (down path acc)))))))
(else (else
(up file acc))))))) (up file acc))))))))
(else (else
(here file acc)))))) (here file acc))))))