-
-
Notifications
You must be signed in to change notification settings - Fork 7.3k
fs.watch() appears to be very broken on Windows VMs #2839
Comments
Note: This was in Windows 7 / XP Parallels VM images running on OS X. |
I tryed your test in XP and it works well: watch_test.js |
All go ok Tested on windows 7 32bits I edited the 3 of them and deleted the last. C:\xampp\htdocs\bugtrack\nodejs\2839>node test.js |
Hi Ben! i setup a test on Virtualbox ubuntu guest command line.
i also investigated further and got to this issue from 3 months ago - remy/nodemon#75 Remy documented this problem and seem to have some sort of a workaround - https://github.com/remy/nodemon#help-my-changes-arent-being-detected |
Maybe parts of Node.js just don't work with Windows 7 running in a VM. |
there is a WIN32 API "SHChangeNotifyRegister". Can it be used ? |
@orangemocha ... thoughts on this one? |
Cloud not reproduce this issue, so I am closing it. If this is still an issue feel free to reopen, ideally attaching an updated test case. |
TL;DR: In a Windows 7 VM (I've seen this same behavior in a Windows XP VM) false positives are fired on
fs.watch()
watchers when once-watched files are recreated, and changing files doesn't trigger a change event. In addition, anUnknown system errno 995 exception
is thrown. A lot. But everything appears to work just fine in OS X 10.7.Anyways... this script (included at the bottom of this post) watches the files
1
,2
, and3
for changes (only if they exist). Once any of them has changed, they are all un-watched, and then any that still exist are re-watched. I've tested this in Node.js v0.6.11.In the following transcripts,
<<WAITING>>
means the script had paused, waiting for something to happen. Any other<< ... >>
describe some action I took.In OS X 10.7, this behaves as you'd expect. When files are deleted or changed, a change event is fired, When files are recreated after being deleted, no change event is fired. After all files have been deleted, the process doesn't exit (bug?)
(The following assumes that files
1
,2
and3
already exist)In Windows 7 (I've seen this same behavior in Windows XP) false positives are fired on watchers when once-watched files are recreated, and changing files doesn't trigger a change event. In addition, an
Unknown system errno 995
exception is thrown. A lot.(The following assumes that files
1
,2
and3
already exist)And here's the script used in these examples:
The text was updated successfully, but these errors were encountered: