Skip to content

Fix nob_needs_rebuild with open files in windows#246

Open
eduardomosko wants to merge 1 commit into
tsoding:mainfrom
eduardomosko:main
Open

Fix nob_needs_rebuild with open files in windows#246
eduardomosko wants to merge 1 commit into
tsoding:mainfrom
eduardomosko:main

Conversation

@eduardomosko

Copy link
Copy Markdown

Windows sucks

But anyway, I need to check if an exe needs_rebuild while it is running because of hot-reload reasons, and it won't work with GENERIC_READ.

As per https://learn.microsoft.com/en-us/windows/win32/api/fileapi/nf-fileapi-createfilea changing that to 0 works for querying the modification time.

If this parameter is zero, the application can query certain metadata such as file, directory, or device attributes without accessing that file or device, even if GENERIC_READ access would have been denied.

So yeah, accept this if you want.

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.

1 participant