Hi, just playing around with hawk, learning clojure, etc.
I noticed that if I add a directory, the watcher previously set no longer watches the new directory
For example, if I do:
(hawk/watch! [{:paths ["/tmp/darktable_exported"]
:handler (fn [ctx e]
(println "event: " e)
(println "context: " ctx)
ctx)}])
and do:
mkdir /tmp/darktable_exported/August_2016
I see in the repl:
event: {:file #object[java.io.File 0x1c5661ba /tmp/darktable_exported/August_2016], :kind :create}
context: {}
But then when I do:
touch /tmp/darktable_exported/August_2016/1.jpg
I see nothing in the repl.
If I restart the watcher, it will see the 1.jpg addition:
boot.user=> event: {:file #object[java.io.File 0x2c8a60ac /tmp/darktable_exported/August_2016/1.jpg], :kind :create}
context: {}
event: {:file #object[java.io.File 0x173395d8 /tmp/darktable_exported/August_2016/1.jpg], :kind :modify}
context: {}
So one fix from my end is to just check if the addition is a directory, and if it is, then toggle my watcher off and on. I also read in one of the other directory watching implementations that there is some sort of bug with recursively watching new directories, so actually fixing this within hawk is likely well beyond my freshly-minted clojure skill.
Hi, just playing around with hawk, learning clojure, etc.
I noticed that if I add a directory, the watcher previously set no longer watches the new directory
For example, if I do:
and do:
I see in the repl:
But then when I do:
I see nothing in the repl.
If I restart the watcher, it will see the 1.jpg addition:
So one fix from my end is to just check if the addition is a directory, and if it is, then toggle my watcher off and on. I also read in one of the other directory watching implementations that there is some sort of bug with recursively watching new directories, so actually fixing this within hawk is likely well beyond my freshly-minted clojure skill.