If file does not exist when watcher is started, does not watch
Hello Will,
I picked this library among others because it supports watching single files rather than directories (unlike other libraries like clojure-watch or juxt/dirwatch). However, I ran into an issue:
If I start a watcher on a single file that does not exist, it does not notice when the file is created. But if I start it when the file exists, it notices deletion and creation. Is this intended behavior?
Thanks in advance.
Also, it crashes on Linux, for example:
(hawk/watch! [{:paths ["/foobar"]
:handler (constantly nil)}])
When /foobar does not exist, it crashes on Linux, but passes on OS X.
java.nio.file.NoSuchFileException: /foobar
at sun.nio.fs.UnixException.translateToIOException (UnixException.java:86)
sun.nio.fs.UnixException.asIOException (UnixException.java:111)
sun.nio.fs.LinuxWatchService$Poller.implRegister (LinuxWatchService.java:246)
sun.nio.fs.AbstractPoller.processRequests (AbstractPoller.java:260)
sun.nio.fs.LinuxWatchService$Poller.run (LinuxWatchService.java:329)
java.lang.Thread.run (Thread.java:748)
Hey there! Thanks for using the library!
This does not seem like the intended behavior, I'll take a look.
I don't mean to bother, but is this being worked on at all?
BTW, I made a simple library to work around this: https://github.com/dryewo/mem-files