"unlink" not fired, when watching single file (Mac) #9

vojtajina opened this Issue Jul 22, 2012 · 9 comments

5 participants

$ touch some.file
chokidar.watch('some.file', {persistent: true})
    .on('unlink', function() {console.log('unlink', arguments)});
$ rm some.file

Won't fire the unlink event.

Watching directory works fine.


yep reproduced, fix is coming


this is actually more complicated than I thought


Any updates on this, I'm having this issue as well. Mac OSX 10.6.7. Node v0.8.2.

Great module by the way. File watching is such a powerful thing, your project is the best solution so far. Thanks!


thanks for thanks; nope no updates, didn’t had an use case yet


I think I will try to work on this today-tomorrow.


When I delete a file (Mac, right click, remove file, which is what I normally do), it says ".DS_Store changed", so that's a start.

@shama shama referenced this issue in gruntjs/grunt Sep 4, 2012

Modify watch task to use chokidar #399


Still having this issue in OSX. Is this one impossible to solve?


possible, just requires not super simple changes. feel free to submit PR.


This appears to be fixed in current master branch when using fsevents or polling.

One catch is that in polling mode it exits after the file was deleted if that was the only thing being watched. But I'm still doing more work on making the behaviors more consistent.

@es128 es128 added a commit that referenced this issue Oct 19, 2014
@es128 es128 Make it possible to watch non-existent files

More testing needed
@es128 es128 added a commit that referenced this issue Oct 21, 2014
@es128 es128 Add test for unlink of watched file a841236
@es128 es128 closed this in #163 Oct 21, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment