A Clojure library providing a facade for Java's WatchService.
Pull the depenency with leiningen (add this in your project.clj)
[spootnik/watchman "0.3.7"](watch.man/watch!
"/some/dir"
(fn [event] (println (pr-str event))))watch! accepts an optional map argument with the following keys:
event-types: a collection of any keywords from:create,:modify,:delete
watch! returns the underlying WatchService, watch.man/close can
be called on the service.
Each argument to the callback when using watch! will be a map with
the following keys:
type::path,:exceptionor:closingpath: The path a:pathevent happens ontypes: The types of event a:pathevent was triggered forsrv: The watch serviceexception: The exception that was raised for:exceptionevents.
- Readme improvements by @blak3mill3r
Copyright © 2015-2019 Pierre-Yves Ritschard, ISC License
