Skip to content
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

Windows emits too many events #147

Closed
wants to merge 1 commit into from

Conversation

bpasero
Copy link

@bpasero bpasero commented Sep 25, 2021

This PR fixes #121

By simply copying what the standard .NET runtime on Windows does when using their file system watcher class out of the box:

continueExecuting = Interop.Kernel32.ReadDirectoryChangesW(
  state.DirectoryHandle,
  state.Buffer, // the buffer is kept pinned for the duration of the sync and async operation by the PreAllocatedOverlapped
  _internalBufferSize,
  _includeSubdirectories,
  (uint)_notifyFilters,
  null,
  overlappedPointer,
  null
);

(source)

Where _notifyFilters is: NotifyFilters.LastWrite | NotifyFilters.FileName | NotifyFilters.DirectoryName
(source)

@bpasero bpasero closed this Nov 16, 2023
@bpasero bpasero deleted the windows/reduce-event-filters branch November 16, 2023 06:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

too many duplicate events
1 participant