Skip to content

Instantly share code, notes, and snippets.

@ZucchiniZe
Created February 15, 2016 10:00
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ZucchiniZe/f24fdcb346ed070ec2f3 to your computer and use it in GitHub Desktop.
Save ZucchiniZe/f24fdcb346ed070ec2f3 to your computer and use it in GitHub Desktop.
simple clojure function to recursively list files in directories.
(let [directory (clojure.java.io/file "/path/to/list")
dir? #(.isDirectory %)]
(map #(.getPath %)
(filter (comp not dir?)
(tree-seq dir? #(.listFiles %) directory))))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment