Uh oh!
There was an error while loading. Please reload this page.
Build Runner: Initial Implementation for File System Watching on Windows - #20667
Conversation
Uh oh!
There was an error while loading. Please reload this page.
jayrod246
commented
Jul 18, 2024
Thoughts on where or how I can reintroduce it? Or if there is an Nt way it can be replicated? |
squeek502
left a comment
There was a problem hiding this comment.
Re-adding kernel32.ReadDirectoryChangesW seems fine for now IMO. The Nt implementation can be figured out later (FWIW it looks like the relevant ntdll function is NtNotifyChangeDirectoryFileEx)
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
jayrod246
commented
Jul 19, 2024
I added an error return to readChanges and some accountability for resources. I still need to deal with this point though:
|
Instead of keying on the file handle itself, which is determined to be different each NtCreateFile call, would it be best to key on a FILE_ID_INFORMATION structure returned by NtQueryInformationFile? I believe that it is unique per file and volume. If it already exists, I would just close that handle and keep the existing one open. edit: Further reading I found that |
I think the way to go might be:
Then hash the combination of those. Some examples of calling (I'd recommend using that |
jayrod246
commented
Jul 23, 2024
Forgot that I had to add |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
8effc49 to
4329052CompareUh oh!
There was an error while loading. Please reload this page.
squeek502
left a comment
There was a problem hiding this comment.
Looking good IMO, nice work!
Seems to be working as expected from my testing. Tested on NTFS, FAT32, and a networked Samba share and they all worked fine.
Uh oh!
There was an error while loading. Please reload this page.
- additionally, the parameter must be nonzero: https://learn.microsoft.com/en-us/windows/win32/api/synchapi/nf-synchapi-waitformultipleobjects
- additionally, introduces FileNotifyChangeFilter to improve use/readability
andrewrk
commented
Jul 29, 2024
Nice work! |
Closes#20598.
This initial implementation has the limit of 64 directories due to the usage of WaitForMultipleObjects. If merged, a follow up issue should be created to track overcoming that limitation.Using IO completion ports instead of WaitForMultipleObjects, I am able to observe more than 64 directories at once.
BTW First time contributing, not very experienced with contributing on GitHub in general, but I love Zig. And I saw this issue and thought it would be a good learning opportunity for me.