(defun walk-directory-tree (file-handler pathname)
"Walks down a directory tree and calls the FILE-HANDLER on every
non-directory file.
You can invoke the restart SKIP-FILE to skip processing of the current file, or
RETRY to call your FILE-HANDLER again with the same file."
(map-directory (lambda (file)
(if (uiop/filesystem:directory-exists-p file)
(walk-directory-tree file-handler file)
(with-retry retry "Try processing this file again"
(restart-case (funcall file-handler file)
(skip-file () :report "Skip this file"
nil)))))
pathname))
;; Write the code here.
Provides: WALK-DIRECTORY-TREE Requires: UIOP, WITH-RETRY https://github.com/stylewarning/quickutil/issues/65 Author: j3pic License: BSD