File tree 2 files changed +17
-3
lines changed
2 files changed +17
-3
lines changed Original file line number Diff line number Diff line change 11
11
[overtone/at-at " 0.2.1" ]
12
12
[overtone/osc-clj " 0.7.1" ]
13
13
[overtone/byte-spec " 0.3.1" ]
14
- [overtone/midi-clj " 0.2.1" ]]
14
+ [overtone/midi-clj " 0.2.1" ]
15
+ [clj-glob " 1.0.0" ]]
15
16
:dev-dependencies [[marginalia " 0.2.0" ]]
16
17
:jvm-opts [" -Xms256m" " -Xmx1g" " -XX:+UseConcMarkSweepGC" ])
Original file line number Diff line number Diff line change 3
3
:author " Sam Aaron" }
4
4
overtone.helpers.file
5
5
(:use [clojure.java.io]
6
- [overtone.helpers.string]))
6
+ [overtone.helpers.string])
7
+ (:require [org.satta.glob :as satta-glob]))
7
8
8
9
(defn- files->abs-paths
9
10
" Given a seq of java.io.File objects, returns a seq of absolute paths for each
49
50
" Given a path to a directory, returns a seq of java.io.File objects
50
51
representing the directory contents"
51
52
[path]
52
- (seq (.listFiles (file (resolve-abs-path path)))))
53
+ (let [path (resolve-abs-path path)
54
+ f (file path)]
55
+ (if (.isDirectory f)
56
+ (seq (.listFiles f))
57
+ (satta-glob/glob path))))
53
58
54
59
(defn ls-paths
55
60
" Given a path to a directory, returns a seq of strings representing the full
90
95
[path]
91
96
(let [files (filter #(.isDirectory %) (ls* path))]
92
97
(files->names files)))
98
+
99
+ (defn glob
100
+ " Given a glob pattern returns a seq of java.io.File instances which match.
101
+ Ignores dot files unless explicitly included.
102
+
103
+ Examples: (glob \" *.{jpg,gif}\" ) (glob \" .*\" ) (glob \" /usr/*/se*\" )"
104
+ [pattern]
105
+ (satta-glob/glob pattern))
You can’t perform that action at this time.
0 commit comments