Skip to main content

walk-file-tree

function

babashka.fs/walk-file-tree

(walk-file-tree [f {:keys [:pre-visit-dir :post-visit-dir :visit-file :visit-file-failed :follow-links :max-depth]}])
Walks `f` using [Files/walkFileTree](https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/nio/file/Files.html#walkFileTree(java.nio.file.Path,java.util.Set,int,java.nio.file.FileVisitor)). Options: * [`:follow-links`](/README.md#follow-links) * `:max-depth` maximum directory depth to walk, defaults is unlimited * Override default visitor functions via: * `:pre-visit-dir` args `[dir attrs]` * `:post-visit-dir` args `[dir ex]` * `:visit-file` args `[file attrs]` * `:visit-file-failed` args `[file ex]` All visitor functions must return one of `:continue`, `:skip-subtree`, `:skip-siblings` or `:terminate`. A different return value will throw. When not supplied, visitor functions default to `(constantly :continue)`. Returns `f` as `Path`.

No examples yet. Be the first to add one!