Skip to content

Instantly share code, notes, and snippets.

@aberant
Created December 9, 2009 16:12
Show Gist options
  • Select an option

  • Save aberant/252566 to your computer and use it in GitHub Desktop.

Select an option

Save aberant/252566 to your computer and use it in GitHub Desktop.
(import '(java.io File))
(defn file-list
"returns a lists of files in a directory"
([dir] (.listFiles (File. dir) )))
(defn file-names [dir]
(map #(.getName %) (file-list dir)))
(defn ruby-files [dir]
(filter #(re-find #"\.rb" %) (file-names dir)))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment