Skip to content

Instantly share code, notes, and snippets.

@abedra
Created August 14, 2009 17:19
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save abedra/167970 to your computer and use it in GitHub Desktop.
Save abedra/167970 to your computer and use it in GitHub Desktop.
(defn filenames-in-dir
"Returns pathnames relative to the dir."
[dir]
(map #(.. % getPath (replace dir ""))
(file-seq (java.io.File. dir))))
(defn available-books
(filter #(re-find #"pdf$" %) (filenames-in-dir "public/books")))
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment