Created
February 15, 2016 10:00
-
-
Save ZucchiniZe/f24fdcb346ed070ec2f3 to your computer and use it in GitHub Desktop.
simple clojure function to recursively list files in directories.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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