-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
FileSystemEntry.Unix: ensure properties are available when file is deleted. #60214
Conversation
…leted. When the file no longer exists, we create attributes based on what we know. The test for this was passing because it cached the attributes before the item was deleted due to enumerating with skipping FileAttributes.Hidden.
Tagging subscribers to this area: @dotnet/area-system-io Issue DetailsWhen the file no longer exists, we create attributes based on what we know. The test for this was passing because it cached the attributes before the @carlossanlop ptal.
|
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Unix.cs
Show resolved
Hide resolved
I'll extend the tests so it covers more of the changes. |
This is up for review. |
@carlossanlop ptal. This fixes a bug in how |
@dotnet/area-system-io @stephentoub ptal. |
@jeffhandley @carlossanlop @jozkee @adamsitnik can you make some time to review the PRs I've created for System.IO: https://github.com/dotnet/runtime/pulls?q=is%3Aopen+is%3Apr+author%3Atmds+label%3Aarea-System.IO. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Overall LGTM, but it would be great if @carlossanlop or @jozkee could review the FileSystemEntry
changes.
src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Enumeration/AttributeTests.cs
Outdated
Show resolved
Hide resolved
src/libraries/Common/tests/TestUtilities/System/AssertExtensions.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Unix.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Unix.cs
Show resolved
Hide resolved
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Unix.cs
Show resolved
Hide resolved
I'll look at addressing the feedback tomorrow. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM so far, only 3 things left to address:
- Remove the
AssertExtensions.EqualsTo
code. - Please open an issue to describe the two bugs being fixed by this PR.
- In particular, the second bug, which you mentioned in a comment in line 333 of FileStatus.Unix.cs, I'm not sure how you caught that, or if it needs a unit test to verify the change worked. Would you mind elaborating? Normally we expect to have an issue open first, where the bug is described and discussed.
Thanks for sending the PR, and apologies for the delay.
src/libraries/System.Private.CoreLib/src/System/IO/Enumeration/FileSystemEntry.Unix.cs
Show resolved
Hide resolved
@carlossanlop I've created #61764 to described the issues that are fixed by this PR. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, thank you @tmds!
Thanks for the review @adamsitnik and @carlossanlop! |
When the file no longer exists, we create attributes based on what we know.
The test for this was passing because it cached the attributes before the
item was deleted due to enumerating with skipping FileAttributes.Hidden.
@carlossanlop ptal.