Look at each source file of a scenery once

The watch of scenery files asked three times per file, whether it is there,
its time and its size, every two seconds for every source of every scenery.
One look gives all three.
This commit is contained in:
maj00r
2026-11-03 21:51:56 +01:00
parent 9eb10fc9bd
commit d68999dfb7
4 changed files with 13 additions and 3 deletions

View File

@@ -200,6 +200,9 @@ public sealed class InMemoryFileSystem : IFileSystem
/// <summary>Files added through <see cref="WithExecutable"/> carry the execute bit.</summary>
public long GetFileSize(string path) => Bytes(path).LongLength;
public (DateTime LastWriteUtc, long Size)? LastWriteAndSize(string path) =>
FileExists(path) ? (GetLastWriteTimeUtc(path), GetFileSize(path)) : null;
public bool IsExecutable(string path) => _executable.Contains(Normalize(path));
public InMemoryFileSystem WithExecutable(string path, string contents = "\u007fELF")