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

Can't remove and re-create files that are being watched by inotify #1535

Closed
saschagehlich opened this issue Dec 23, 2016 · 6 comments
Closed

Comments

@saschagehlich
Copy link

  • 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 vim trying 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
@benhillis
Copy link
Member

@saschagehlich - are you using a DrvFs path (/mnt/c/...) or a different location?

@JasonLinMS could you please have a look?

@JasonLinMS
Copy link

Thanks Ben. @saschagehlich Please let us know and we will investigate.

@saschagehlich
Copy link
Author

@benhillis @JasonLinMS This only seems to happen on DrvFs paths

@saschagehlich
Copy link
Author

@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 :(

@JasonLinMS
Copy link

@saschagehlich I can repro this and will start investigating, sorry for the delay!

@JasonLinMS
Copy link

Marking as a duplicate of #966, we are looking at a fix for this issue.

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

No branches or pull requests

3 participants