diff --git a/src/NexusMods.Paths/FileSystemAbstraction/InMemoryFileSystem/InMemoryFileSystem.cs b/src/NexusMods.Paths/FileSystemAbstraction/InMemoryFileSystem/InMemoryFileSystem.cs index 4ba9829..8b38968 100644 --- a/src/NexusMods.Paths/FileSystemAbstraction/InMemoryFileSystem/InMemoryFileSystem.cs +++ b/src/NexusMods.Paths/FileSystemAbstraction/InMemoryFileSystem/InMemoryFileSystem.cs @@ -84,6 +84,8 @@ private InMemoryFileEntry InternalAddFile(AbsolutePath path, byte[] contents) _files.Add(path, inMemoryFile); directory.Files.Add(inMemoryFile.Path.RelativeTo(directory.Path), inMemoryFile); + inMemoryFile.CreationTime = DateTime.UtcNow; + inMemoryFile.LastWriteTime = DateTime.UtcNow; return inMemoryFile; } @@ -288,6 +290,7 @@ private InMemoryFileEntry InternalCreateFile(AbsolutePath path, FileMode mode, F if (inMemoryFileEntry is null) throw new FileNotFoundException($"File \"{path.GetFullPath()}\" does not exist"); + inMemoryFileEntry.LastWriteTime = DateTime.UtcNow; return inMemoryFileEntry; }