Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If file does not exist when watcher is started, does not watch #20

Open
dryewo opened this issue Jan 19, 2018 · 4 comments
Open

If file does not exist when watcher is started, does not watch #20

dryewo opened this issue Jan 19, 2018 · 4 comments

Comments

@dryewo
Copy link

dryewo commented Jan 19, 2018

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.

@dryewo
Copy link
Author

dryewo commented Jan 20, 2018

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)

@wkf
Copy link
Owner

wkf commented Jan 22, 2018

Hey there! Thanks for using the library!

This does not seem like the intended behavior, I'll take a look.

@NoahTheDuke
Copy link

I don't mean to bother, but is this being worked on at all?

@dryewo
Copy link
Author

dryewo commented Oct 4, 2018

BTW, I made a simple library to work around this: https://github.com/dryewo/mem-files

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants