cavm.dir-watch

Shim for old jvms without file watch service.

check-files

(check-files dir old-times)
Return new, old, and changed files, plus latest file timestamps.

diff

(diff a b)
Diff two maps. This is much faster than using clojure.set methods.

dir-change-queue

(dir-change-queue dir queue & [{:keys [interval], :or {interval (* 30 sec)}, :as opts}])
Accumulate filesystem changes into the given atom, as {file timestamp ...}.
This should typically be a priority queue.

dir-watcher

(dir-watcher cb dir & [{:keys [interval initial-files], :or {interval (* 30 sec), initial-files nil}}])
Watch a directory tree 'dir' for changes, calling 'cb' on any change, with
a map of :old :new and :changed file lists, plus a map of all files to their
timestamps. Returns a function that terminates the watcher.

file-timestamps

(file-timestamps dir)

poller

(poller running poll-agent cb interval dir old)

sec

type-file

(type-file dir)