Skip to content

Conversation

boenrobot
Copy link

@boenrobot boenrobot commented Oct 21, 2025

Replace ReadDirectoryChangesW with ReadDirectoryChangesExW, out of which the FileAttributes can tell if a file or folder is being created/modified/deleted.

This raises the minimum required Windows version to Windows 10, as this is where ReadDirectoryChangesExW was introduced.

Fixes #261

};
}
match cur_entry.Action {
FILE_ACTION_RENAMED_OLD_NAME => {
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I also rolled the FILE_ACTION_RENAMED_OLD_NAME into the match... Because I can't see any reason it shouldn't be in it already. Was there a good reason that I'm unaware of? If so, I can revert this part.

@boenrobot boenrobot marked this pull request as draft October 21, 2025 12:40
…ich the FileAttributes can tell if a file or folder is being created/modified/deleted.

This raises the minimum required Windows version to Windows 10, as this is where ReadDirectoryChangesExW was introduced.
@boenrobot
Copy link
Author

boenrobot commented Oct 21, 2025

As per @JohnTitor in #261, I made it backwards compatible for older versions of Windows too, with a one time runtime check (the results of which are passed around). Did so by effectively duplicating handle_event (into handle_extended_event). I'm sure there's portions of the code that can be made more DRY, but then again, it might be less error prone to have to keep up to date two copies, and maybe eventually drop the older one.

…le (Windows versions earlier than 10).

Checked dynamically once at server creation and passed along to the ReadData.
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.

CreateKind | RemoveKind | ModifyKind seem to always be Any most of the time?

1 participant