-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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 LastWriteTime and LastAccessTime of a symlink on Windows and Unix #52639
Conversation
Tagging subscribers to this area: @carlossanlop Issue DetailsFixes #38824.
|
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.
The change looks good so far, @hamarb123, thanks for the fix.
As mentioned in your description, unit tests should be included, so please ping me when you add them.
Hi @hamarb123 -- it looks like the we were waiting for some unit tests to be added. Let us know if you need any help or guidance on that. Thanks! |
@jeffhandley, unit tests are in #49555, they just need to be enabled on Windows when #49555 is merged. |
Ah; I'm sorry I overlooked that @hamarb123! |
@jozkee This PR is assigned to you for follow-up/decision before the RC1 snap. |
I'm separating out the symlink code into this PR for Unix from #49555 as per #49555 (comment). |
I'm not sure how to make this PR include the changes of the other PR without having it as seperate commits that need to also be merged, so for now I'll just remove the relevant code from #49555 and add it here once it's merged. If it is possible, please let me know how I can do it because this PR needs to change files added in #49555. |
Draft Pull Request was automatically closed for inactivity. Please let us know if you'd like to reopen it. |
I see this is blocked on #49555. Perhaps we/you can reopen this PR when this is unblocked. |
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Directory/GetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
• Rename item field to link field • Don't use if one-liner • Use all time functions since only using UTC isn't necessary • Remove the now-defunct IsDirectory property since we aren't checking it anymore
• Remove unnecessary fsi.Refresh() since atime is only updated when reading a file
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, thanks!
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.IO.FileSystem/tests/Base/BaseGetSetTimes.cs
Outdated
Show resolved
Hide resolved
• Remove targetIsRelative cases • Multi-line if statement • Combine HAVE_LUTIMES and #else conditions to allow more code charing
Breaking change doc issue: dotnet/docs#31483 |
Fixes #38824.
Fixes setting the LastWriteTime and the LastAccessTime on a symlink on Windows and Unix.
Somewhat reliant on #49555.
Reverts the Windows changes of the commit a617a01 (on the #49555 PR) to fix #38824 and for Unix: hamarb123@f842935.