mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-07-07 05:06:37 +02:00
Handling case where opendir fails in directory-fold-tree.
This commit is contained in:
parent
8ddee1f704
commit
3c8c1fe74b
1 changed files with 12 additions and 11 deletions
|
@ -49,17 +49,18 @@
|
|||
(cond
|
||||
((file-directory? file)
|
||||
(let ((d (opendir file)))
|
||||
(let lp ((acc acc))
|
||||
(let ((e (readdir d)))
|
||||
(cond
|
||||
(e
|
||||
(let ((f (dirent-name e)))
|
||||
(if (member f '("." ".."))
|
||||
(lp acc)
|
||||
(let ((path (string-append file "/" f)))
|
||||
(lp (fold path (down path acc)))))))
|
||||
(else
|
||||
(up file acc)))))))
|
||||
(if (not d)
|
||||
(let lp ((acc acc))
|
||||
(let ((e (readdir d)))
|
||||
(cond
|
||||
(e
|
||||
(let ((f (dirent-name e)))
|
||||
(if (member f '("." ".."))
|
||||
(lp acc)
|
||||
(let ((path (string-append file "/" f)))
|
||||
(lp (fold path (down path acc)))))))
|
||||
(else
|
||||
(up file acc))))))))
|
||||
(else
|
||||
(here file acc))))))
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue