-
-
Notifications
You must be signed in to change notification settings - Fork 10
Closed
Description
As the title states using the different write methods of IFile does not change the LastWriteTimeUtc of IFileInfo. Refresh() is called.
In the following example both Console.WriteLine write the same time
Code:
public static async Task Main(string[] args)
{
var fileSystem = new MockFileSystem();
IFileInfo fileInfo = fileSystem.FileInfo.New("test.txt");
fileInfo.Create().Dispose();
fileInfo.Refresh();
Console.WriteLine(fileInfo.LastWriteTimeUtc);
await Task.Delay(2000);
fileSystem.File.WriteAllText(fileInfo.FullName, "test");
fileInfo.Refresh();
Console.WriteLine(fileInfo.LastWriteTimeUtc);
}Actual Behavior: IFileInfo.LastWriteTimeUtc is not updated after using IFile.Write...
Expected Behavior: IFileInfo.LastWriteTimeUtc is updated to be 2s after the previous read
Possible Solution: It could be related to [FileSystem] Bug: Caching IFileInfo, recreating it, will result in stale cache
Metadata
Metadata
Assignees
Labels
No labels