-
Notifications
You must be signed in to change notification settings - Fork 4.9k
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
Can no longer get file attributes from exclusively locked files #26216
Comments
Is this the cause of https://github.com/dotnet/corefx/issues/29784? Ie that's a dupe? |
Seems to be a regression since 2.0. |
Previously we would try again with FindFirstFile for any failure of GetFileAttributes other than 3 specific codes: Now we only try again for ERROR_ACCESS_DENIED |
I'm creating tests for this scenario now and a fix. |
The original change was done nearly 11 months ago: dotnet/corefx@0cdb9f3 |
@JeremyKuhne could you please make a 2.1 port and mark no merge.. |
Yep, I should have this up today. |
Problem
IO.File.GetAttributes() doesn't return attributes for exclusively locked file like c:\pagefile.sys
IO.File.Exist() doesn't found such file (return false).
Repo on PowerShell
In PowerShell repo we have a workaround:
Without the workaround PowerShell doesn't show the file:
but cmd.exe show the file:
Suggestion
I believe the issue should be fixed in CoreFX here
https://github.com/dotnet/corefx/blob/f25eb288a449010574a6e95fe298f3ad880ada1e/src/System.IO.FileSystem/src/System/IO/FileSystem.Windows.cs#L203-L223
ERROR_SHARING_VIOLATION should be added.
The text was updated successfully, but these errors were encountered: