Finds files based on glob patterns like "*.jpg"
or "/usr/*/se*"
. Similar to glob in Perl, Ruby, and PHP.
(use 'org.satta.glob))
(glob "*.{jpg,gif}")
=> (#<File cat.jpg> #<File dog.gif>)
(glob "*.{jpg,gif}" :s) ; return string of path by adding :s option
=> ("cat.jpg" "dog.gif")
(glob "*.JPG" :i) ; ignore case.
=> (#<File cat.jpg>)
(glob ".*") ; dot files are not included by default
=> (#<File .git> #<File .gitignore>)
(glob "*g*" :a) ; dot files are included by adding :a option
=> (#<File .git> #<File .gitignore>)
(glob "/usr/*/se*") ; works on directories and subdirectories
=> (#<File /usr/bin/security> #<File /usr/bin/sed> ...)
(glob "**/*clj") ; zsh's ** recursive search can be used.
=> (#<File project.clj> #<File src/org/satta/glob.clj> #<File test/org/satta/glob_test.clj>)
(glob "c:/Windows/*/*.dll") ; works on Windows
Add this dependency to your project.clj:
[org.clojars.hozumi/clj-glob "0.1.2"]
EPL
Can you improve this documentation? These fine people already did:
Takahiro Hodumi, Justin Kramer, Takahiro Hozumi & QertoipEdit on GitHub
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close