ThomasMonkman / filewatch

File watcher in c++
MIT License
436 stars 73 forks source link

On MacOs - Enhance handleFsEvent to manage file and directory events more precisely #51

Open undici77 opened 2 months ago

undici77 commented 2 months ago

Environment: MacOS

Description:

When more than one instance of the FileWatch class (filewatch::FileWatch) is instantiated on MacOS, an unexpected behavior occurs: whenever a file change event is detected, all instances of FileWatch receive notifications for every file change, regardless of whether the change pertains to the specific files they are monitoring.

Steps to Reproduce:

Create multiple instances of filewatch::FileWatch, each monitoring different files or directories.
Make a change to any of the monitored files.
Observe that all instances are triggered, receiving events for files they are not supposed to monitor.

Expected Behavior: Each FileWatch instance should only receive notifications for the specific files or directories it is monitoring. Events should be localized to the corresponding instance.

Actual Behavior: All FileWatch instances receive file change notifications.