Closed blarfoon closed 4 years ago
Is there a code sample and a sequence of commands which caused the problem?
var watch = require('node-watch');
watch('./dir', { recursive: true }, function(evt, name) {
console.log('%s changed.', name);
});
Something like this. Then just start cutting and pasting like 300 files and you should be able to reproduce it.
OK. I need more information. I can't reproduce it on my computer (Mac, Node v11.7.0, node-watch 0.6.3)
Sounds like a system limit like ulimit or fs.max-open-files issue
I test it counting the files that I'm copying, and then implementing a counter in the listener. This just happens on cutting as far as I know. No nested directories. Chokidar and NSFW works perfectly fine
I wrote a test and nothing went wrong on Travis. Also, I managed to find a Desktop Windows to do 'cutting and pasting' of 300 files but I couldn't reproduce it either.
There's a delay (200ms) to respond to an event. Maybe there's something wrong about the counting method.
May I know how did you implement the counter?
Or try both node-watch
with option{ delay: 0 }
and native fs.watch()
to see if there's any difference
Thank you @killpowa for reporting. I'll close it by now. Also thanks to @crh3675 for the suggestion :)
This works perfectly with a low amount of events, but if I try to copy 200+ files into the watched directory, some of the files will not trigger the callback. I can consistently reproduce this issue, but every time the number of files that trigger the callback is different. Usually, it's around 150 out of 200. UPDATE: It looks like copying files work. Just when I move them it skips some of them. Maybe they're too fast?