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

Fix stat on Windows FAT file systems #288

Merged
merged 4 commits into from
Jul 19, 2021
Merged

Fix stat on Windows FAT file systems #288

merged 4 commits into from
Jul 19, 2021

Conversation

wolfs
Copy link
Member

@wolfs wolfs commented Jul 16, 2021

GetFileInformationByHandleEx returns ERROR_INVALID_PARAMETER
on FAT file systems, so this breaks stat.

See also https://go-review.googlesource.com/c/go/+/154377/.

`GetFileInformationByHandleEx` returns ERROR_INVALID_PARAMETER
on FAT file systems, so this breaks stat.

See also https://go-review.googlesource.com/c/go/+/154377/.
@wolfs wolfs self-assigned this Jul 16, 2021
wolfs added 2 commits July 17, 2021 15:00
for performance reasons when stating non-symlinks.
See #203
So we don't need the error handling on FAT for
the illegal argument.
@wolfs wolfs force-pushed the wolfs/stat-on-fat branch from e6d900a to 8d84401 Compare July 17, 2021 13:00
@wolfs wolfs marked this pull request as ready for review July 17, 2021 13:04
@wolfs
Copy link
Member Author

wolfs commented Jul 17, 2021

I ran the jmh benchmarks in the Gradle project on Windows for these changes:
Before:
image

After:
image

So this fixes #203 as well.

@mlopatkin mlopatkin self-requested a review July 19, 2021 07:14
Copy link
Member

@mlopatkin mlopatkin left a comment

Choose a reason for hiding this comment

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

I'm nowhere near expert in Win32 but overall changes look fine. Couple of suggestions inline.

native-platform/src/main/cpp/win.cpp Show resolved Hide resolved
native-platform/src/main/cpp/win.cpp Outdated Show resolved Hide resolved
since CloseHandle may create its own error.
@wolfs wolfs requested a review from mlopatkin July 19, 2021 09:20
@wolfs wolfs added this to the 0.22 milestone Jul 19, 2021
@wolfs wolfs merged commit 0f0b444 into master Jul 19, 2021
@wolfs wolfs deleted the wolfs/stat-on-fat branch July 19, 2021 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants