Move DevDrive project to repo root

This commit is contained in:
2026-01-05 07:19:06 +11:00
parent 9bf318e41e
commit 9fcad874b9
9 changed files with 8 additions and 0 deletions

39
FloppyFileNode.cs Normal file
View File

@@ -0,0 +1,39 @@
using System.Security.AccessControl;
namespace DevDrive;
/// <summary>
/// Represents a file or directory node in the virtual file system.
/// </summary>
public class FloppyFileNode
{
public string Name { get; set; }
public string FullPath { get; set; }
public bool IsDirectory { get; set; }
public FileAttributes Attributes { get; set; }
public byte[] Data { get; set; }
public DateTime CreationTime { get; set; }
public DateTime LastAccessTime { get; set; }
public DateTime LastWriteTime { get; set; }
public FileSystemSecurity? Security { get; set; }
public string? SymlinkTarget { get; set; }
public bool IsSymlink => !string.IsNullOrEmpty(SymlinkTarget);
public FloppyFileNode(string fullPath, bool isDirectory)
{
FullPath = fullPath.TrimEnd('\\');
Name = Path.GetFileName(fullPath);
if (string.IsNullOrEmpty(Name))
{
Name = "\\";
}
IsDirectory = isDirectory;
Attributes = isDirectory ? FileAttributes.Directory : FileAttributes.Normal;
Data = [];
CreationTime = DateTime.Now;
LastAccessTime = DateTime.Now;
LastWriteTime = DateTime.Now;
}
public long FileSize => IsDirectory ? 0 : Data.Length;
}