-
Notifications
You must be signed in to change notification settings - Fork 4.1k
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: fix JNI's DeletePath function #7176
Conversation
DeletePath now verifies that the input path is Windows-style (i.e. uses backslashes) and absolute, and adds the `\\?\` prefix to the path. Doing so ensures it can delete any file (including degenerately-named ones like `c:\foo\nul`). Fixes bazelbuild#7173
Did you consider making DeletePath compatible with mixed style Windows path? (eg. |
Yes! But doing that requires depending on |
Ah, I see! |
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to #7176 Closes #7178. PiperOrigin-RevId: 230705273
DeletePath now verifies that the input path is Windows-style (i.e. uses backslashes) and absolute, and adds the `\\?\` prefix to the path. Doing so ensures it can delete any file (including degenerately-named ones like `c:\foo\nul`). Fixes bazelbuild#7173 Closes bazelbuild#7176. PiperOrigin-RevId: 229913623
Also remove the GetAttributesOfMaybeMissingFile method because it's based on a false belief, namely that FindFirstFile returns up-to-date information. According to this OldNewThing post that belief was wrong: https://blogs.msdn.microsoft.com/oldnewthing/20111226-00/?p=8813 This PR is a follow-up to bazelbuild#7176 Closes bazelbuild#7178. PiperOrigin-RevId: 230705273
DeletePath now verifies that the input path is
Windows-style (i.e. uses backslashes) and
absolute, and adds the
\\?\
prefix to the path.Doing so ensures it can delete any file (including
degenerately-named ones like
c:\foo\nul
).Fixes #7173