inotify: don't ignore events for files that don't exist #36
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
port of fsnotify/fsnotify#470
This is quite an odd check, leading to an inconsistent event stream, which also doesn't match what other platforms do. If you do a "CREATE + MODIFY + REMOVE" in quick succession then you probably want all three events. If you don't want to operate on non-existing files, then you can check this in your application code.
You need to do that already, since this check is far from reliable. In the time between this check and the application code doing something with an event the file may have been deleted already.
I looked a bit at the history of this, and looks like it was added in 2013 with cc2c34e; issue 36 refers to this issue on the old repo, which mentions it fixes a memory leak: howeyc/fsnotify#36
I can't reproduce that at all; using the CLI from #463 modified to print the memory and running:
Memory stays at about 100/110K in both the current main branch and this.
So I think it should be safe to remove.
NOTE: Please do not open a pull request that adds or changes the public API without giving consideration to all supported operating systems.