Class FileSystem
FileSystem abstract class.
Inherited Members
Namespace: Cosmos.System.FileSystem
Assembly: Cosmos.System2.dll
Syntax
public abstract class FileSystem
Constructors
| Improve this Doc View SourceFileSystem(Partition, String, Int64)
Initializes a new instance of the FileSystem class.
Declaration
protected FileSystem(Partition aDevice, string aRootPath, long aSize)
Parameters
Type | Name | Description |
---|---|---|
Partition | aDevice | A partiton managed by the filesystem. |
System.String | aRootPath | A root path. |
System.Int64 | aSize | A partition size. |
Properties
| Improve this Doc View SourceAvailableFreeSpace
Get available free space.
Declaration
public abstract long AvailableFreeSpace { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Device
Get device.
Declaration
protected Partition Device { get; }
Property Value
Type | Description |
---|---|
Partition |
Label
Get label.
Declaration
public abstract string Label { get; set; }
Property Value
Type | Description |
---|---|
System.String |
RootPath
Get root path.
Declaration
public string RootPath { get; }
Property Value
Type | Description |
---|---|
System.String |
Size
Get size.
Declaration
public long Size { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
TotalFreeSpace
Get total free space.
Declaration
public abstract long TotalFreeSpace { get; }
Property Value
Type | Description |
---|---|
System.Int64 |
Type
Get type.
Declaration
public abstract string Type { get; }
Property Value
Type | Description |
---|---|
System.String |
Methods
| Improve this Doc View SourceCreateDirectory(DirectoryEntry, String)
Create directory.
Declaration
public abstract DirectoryEntry CreateDirectory(DirectoryEntry aParentDirectory, string aNewDirectory)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aParentDirectory | A parent directory. |
System.String | aNewDirectory | A new directory name. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException | Thrown on memory error / unknown directory entry type. |
System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
System.Exception | Thrown when data size invalid / invalid directory entry type / memory error. |
System.ArgumentException | Thrown on memory error. |
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown on memory error. |
CreateFile(DirectoryEntry, String)
Create file.
Declaration
public abstract DirectoryEntry CreateFile(DirectoryEntry aParentDirectory, string aNewFile)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aParentDirectory | A parent directory. |
System.String | aNewFile | A new file name. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException | Thrown on memory error / unknown directory entry type. |
System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
System.Exception | Thrown when data size invalid / invalid directory entry type / memory error. |
System.ArgumentException | Thrown on memory error. |
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown on memory error. |
DeleteDirectory(DirectoryEntry)
Delete directory.
Declaration
public abstract void DeleteDirectory(DirectoryEntry aPath)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aPath |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown when given entry type is unknown. |
System.Exception |
|
System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
System.ArgumentNullException |
|
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown when the data in aData is corrupted. |
System.ArgumentOutOfRangeException |
|
System.ArgumentException |
|
System.NotSupportedException | Thrown when FAT type is unknown. |
DeleteFile(DirectoryEntry)
Delete file.
Declaration
public abstract void DeleteFile(DirectoryEntry aPath)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aPath |
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown when given entry type is unknown. |
System.Exception |
|
System.OverflowException |
|
System.ArgumentNullException |
|
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown when the data in aData is corrupted. |
System.ArgumentOutOfRangeException |
|
System.ArgumentException |
|
System.NotSupportedException | Thrown when FAT type is unknown. |
DisplayFileSystemInfo()
Print filesystem info.
Declaration
public abstract void DisplayFileSystemInfo()
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown on I/O error. |
Format(String, Boolean)
Format drive. (delete all)
Declaration
public abstract void Format(string aDriveFormat, bool aQuick)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveFormat | unused. |
System.Boolean | aQuick | unused. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException |
|
System.ArgumentNullException | Thrown when filesystem is null / memory error. |
System.ArgumentException |
|
System.Exception |
|
System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
System.NotImplementedException | Thrown when FAT type is unknown. |
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown when the data in aData is corrupted. |
System.NotSupportedException | Thrown when FAT type is unknown. |
GetDirectoryListing(DirectoryEntry)
Get list of sub-directories in a directory.
Declaration
public abstract List<DirectoryEntry> GetDirectoryListing(DirectoryEntry baseDirectory)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | baseDirectory | A base directory. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DirectoryEntry> | DirectoryEntry list. |
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown when baseDirectory is null / memory error. |
System.OverflowException | Thrown when data lenght is greater then Int32.MaxValue. |
System.Exception | Thrown when data size invalid / invalid directory entry type. |
System.ArgumentException | Thrown on memory error. |
System.ArgumentOutOfRangeException | Thrown on memory error. |
GetRootDirectory()
Get root directory.
Declaration
public abstract DirectoryEntry GetRootDirectory()
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown when root directory address is smaller then root directory address. |
System.ArgumentNullException | Thrown when filesystem is null. |
System.ArgumentException | Thrown when root path is null or empty. |