-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
FileSystemWatcher Deleted event not firing when moving multiple files outside the watched folder on macOS 10.13 #30846
Comments
I can reproducer it with 2.1 and 3.0. I will take look. |
The same issue happens when copy files outside the watched folder inside it. In this case, it produces the same events instead of the |
The investigation so far: When a file is renamed the The issue happens when we pair new and old names in case of file rename. When we remove 2 files outside the watched folder it triggers From current observation, those two cases differ only in event id. When a file is renamed, the event number is consecutive. When two files are moved, the event number has a gap. I didn't find any related doc for macOS and I will spend more time to find if we are able to recognize the correct case. |
It seems like there is already some code trying to deal with pairing and note about rename to file out of watched path. If testing strongly suggest that "normal" rename always comes together we can possibly disambiguate multiple renames and simply not provide final path. It seems like kernel does provide such info but I see posts about same struggle. We may need |
The kFSEventStreamCreateFlagWatchRoot flag is already used: https://github.com/dotnet/corefx/blob/a50e056c5a62fb6dfe2e9475be47b93d33661700/src/System.IO.FileSystem.Watcher/src/System/IO/FileSystemWatcher.OSX.cs#L124-L126 However, it doesn't deliver additional events. Pairing events based on event id is not documented as reported in apple radar. The only reliable solution is test each move event with |
This was opened in Mono and bringing it upstream.
From @jesh182 on Tue, 10 Sep 2019 15:01:54 GMT
Steps to Reproduce
Expected Behavior
Console:
Deleted FirstFile.jpg
Deleted SecondFile.jpg
Deleted ThirdFile.jpg
Actual Behavior
Console:
Renamed from: FirstFile.jpg to: SecondFile.jpg
Deleted ThirdFile.jpg
Environment
Build Logs
FSWatcherBuildLog.txt
Example Project (If Possible)
FSWatcherMac.zip
Copied from original issue mono/mono#16778
The text was updated successfully, but these errors were encountered: