mirror of
https://github.com/danbulant/Cosmos
synced 2026-05-19 12:30:32 +00:00
Yet again, my hands are typing words. Jokes aside, deleting doesn't work yet - but at least using System.IO.File.Delete() won't cause a plug issue.
45 lines
1.3 KiB
C#
45 lines
1.3 KiB
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.IO;
|
|
using Cosmos.HAL.BlockDevice;
|
|
using Cosmos.System.FileSystem.FAT;
|
|
using Cosmos.System.FileSystem.Listing;
|
|
|
|
namespace Cosmos.System.FileSystem
|
|
{
|
|
public abstract class FileSystem
|
|
{
|
|
protected FileSystem(Partition aDevice, string aRootPath)
|
|
{
|
|
mDevice = aDevice;
|
|
mRootPath = aRootPath;
|
|
}
|
|
|
|
public static FileSystemType GetFileSystemType(Partition aDevice)
|
|
{
|
|
if (FatFileSystem.IsDeviceFat(aDevice))
|
|
{
|
|
return FileSystemType.FAT;
|
|
}
|
|
|
|
return FileSystemType.Unknown;
|
|
}
|
|
|
|
public abstract void DisplayFileSystemInfo();
|
|
|
|
public abstract List<DirectoryEntry> GetDirectoryListing(DirectoryEntry baseDirectory);
|
|
|
|
public abstract DirectoryEntry GetRootDirectory();
|
|
|
|
public abstract DirectoryEntry CreateDirectory(DirectoryEntry aParentDirectory, string aNewDirectory);
|
|
|
|
public abstract DirectoryEntry CreateFile(DirectoryEntry aParentDirectory, string aNewFile);
|
|
|
|
protected Partition mDevice { get; }
|
|
|
|
public string mRootPath { get; }
|
|
|
|
public abstract void Delete(DirectoryEntry aPath);
|
|
|
|
}
|
|
}
|