Runs but broken

This commit is contained in:
2024-08-31 08:32:06 -07:00
parent f458af776a
commit 326e579d5c
43 changed files with 1763 additions and 654 deletions

View File

@ -20,33 +20,30 @@ public record FileHolder(DateTime? CreationTime,
return result;
}
public static FileHolder Get(FileInfo fileInfo)
{
FileHolder result;
if (!fileInfo.Exists)
result = new(null,
fileInfo.DirectoryName,
fileInfo.Exists,
fileInfo.Extension.ToLower(),
fileInfo.FullName,
null,
null,
fileInfo.Name,
Path.GetFileNameWithoutExtension(fileInfo.FullName));
else
{
result = new(fileInfo.CreationTime,
fileInfo.DirectoryName,
fileInfo.Exists,
fileInfo.Extension.ToLower(),
fileInfo.FullName,
fileInfo.LastWriteTime,
fileInfo.Length,
fileInfo.Name,
Path.GetFileNameWithoutExtension(fileInfo.FullName));
}
return result;
}
private static FileHolder GetExisting(FileInfo fileInfo) =>
new(fileInfo.CreationTime,
fileInfo.DirectoryName,
fileInfo.Exists,
fileInfo.Extension.ToLower(),
fileInfo.FullName,
fileInfo.LastWriteTime,
fileInfo.Length,
fileInfo.Name,
Path.GetFileNameWithoutExtension(fileInfo.FullName));
private static FileHolder GetNonExisting(FileInfo fileInfo) =>
new(null,
fileInfo.DirectoryName,
fileInfo.Exists,
fileInfo.Extension.ToLower(),
fileInfo.FullName,
null,
null,
fileInfo.Name,
Path.GetFileNameWithoutExtension(fileInfo.FullName));
public static FileHolder Get(FileInfo fileInfo) =>
fileInfo.Exists ? GetExisting(fileInfo) : GetNonExisting(fileInfo);
public static FileHolder Get(FilePath filePath)
{