RosettaCodeData/Task/Walk-a-directory-Recursively/Clojure/walk-a-directory-recursively.clj
Ingy döt Net 68f8f3e56b all tasks
2013-04-11 01:07:29 -07:00

7 lines
208 B
Clojure

(use '[clojure.java.io])
(defn walk [dirpath pattern]
(doall (filter #(re-matches pattern (.getName %))
(file-seq (file dirpath)))))
(map #(println (.getPath %)) (walk "src" #".*\.clj"))