-
Notifications
You must be signed in to change notification settings - Fork 260
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
feat: adjust timestamps when accessing and modifying files #861
feat: adjust timestamps when accessing and modifying files #861
Conversation
This sets the timestamps for copied MockFile instances so that the CreationTime and LastAccessTime get the timestamp of the copy operation and the LastWriteTime is inherited from the source as before.
This looks very similar to #860 |
This fixes setting of the appropriate timestamps in the MockFileData instances, when accessing them via the MockFileStream. This contains the implementation intended in TestableIO#860.
Unfortunately after my last commit 920527b an issue cropped up in the static code analysis which claims that "'existingContents' is null on at least one execution path." in src/System.IO.Abstractions.TestingHelpers/MockFileStream.cs#L44. |
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.
See inline comments, mainly clarifications needed.
This removes the premature update of the LastAccessTime timestamp when a MockFileStream is opened.
Sure, done! Thanks for having a look at this! |
This is addressed in release v17.0.21. |
For tests with MockFiles we would like to have the same behaviour as on a real
file system regarding the timestamps on the copied file.