yuanchuan / node-watch

A wrapper and enhancements for fs.watch
https://npm.im/node-watch
MIT License
339 stars 44 forks source link

watch dir bug #103

Closed tsoil closed 3 years ago

tsoil commented 3 years ago

When I listen to a folder, I copy a folder containing files to the monitored directory. can't listen for the update event of the folder, only the update event of the content in the folder

yuanchuan commented 3 years ago

I can't reproduce the bug. Please provide more information like OS, node version etc..

yuanchuan commented 3 years ago

Now it's quite clear. I guess you're using Windows.

The native fs.watch is quite inconsistant while copying a directory:

  1. On Linux, only one event for the root directory, no events for files.
  2. On macOS, the order of the output events are different with different NodeJS versions.
  3. On Windows, the event for directory is being removed due to this PR https://github.com/yuanchuan/node-watch/issues/79, which is a side-effect for this and should be removed. (I suppose it's a bug no longer exist now)