Can't remove and re-create files that are being watched by inotify
- A brief description
When watching a file using inotify (in my case using node.js' fs.watch function), I can't re-create the file after deleting it (either permission denied or no such file or directory)
- Actual results (with terminal output if applicable)
$ echo > file
$ node -p "require('fs').watch('file')" &
[1] 18962
FSWatcher {
domain: null,
_events: {},
_eventsCount: 0,
_maxListeners: undefined,
_handle: FSEvent { owner: [Circular], onchange: [Function] } }
$ rm file
$ echo > file
zsh: no such file or directory: file
$ echo $?
1
$ kill 18962
[1] + 18962 terminated node -p "require('fs').watch('file')"
$ echo > file
$ echo $?
0
-
Your Windows build number 14986
-
Strace of the failing command Here's a trace of
vimtrying to write to the watched file:
write(1, "\"file\"", 6"file") = 6
stat("file", 0x7fffe3fe2080) = -1 ENOENT (No such file or directory)
open("file", O_WRONLY|O_CREAT|O_TRUNC, 0666) = -1 ENOENT (No such file or directory)
lstat("file", 0x7fffe3fe21a0) = -1 ENOENT (No such file or directory)
- Required packages and commands to install Install node.js
@saschagehlich - are you using a DrvFs path (/mnt/c/...) or a different location?
@JasonLinMS could you please have a look?
Thanks Ben. @saschagehlich Please let us know and we will investigate.
@benhillis @JasonLinMS This only seems to happen on DrvFs paths
@benhillis Is this being worked on? I'm running into this very often when switching git branches while my build system is watching for changes :(
@saschagehlich I can repro this and will start investigating, sorry for the delay!
Marking as a duplicate of #966, we are looking at a fix for this issue.