Class CosmosVFS
Cosmos default virtual file system.
Inherited Members
Namespace: Cosmos.System.FileSystem
Assembly: Cosmos.System2.dll
Syntax
public class CosmosVFS : VFSBase
Properties
| Improve this Doc View SourceDisks
List of disks.
Declaration
public List<Disk> Disks { get; }
Property Value
Type | Description |
---|---|
System.Collections.Generic.List<Disk> |
Methods
| Improve this Doc View SourceCreateDirectory(String)
Creates a directory.
Declaration
public override DirectoryEntry CreateDirectory(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path including the directory to create. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
Overrides
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 |
|
System.ArgumentException |
|
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown on memory error. |
System.IO.PathTooLongException | Thrown when The aPath is longer than the system defined maximum length. |
CreateFile(String)
Creates a new file.
Declaration
public override DirectoryEntry CreateFile(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path including the file to create. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
Overrides
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 |
|
System.ArgumentException |
|
System.RankException | Thrown on fatal error. |
System.ArrayTypeMismatchException | Thrown on fatal error. |
System.InvalidCastException | Thrown on memory error. |
System.IO.PathTooLongException | Thrown when The aPath is longer than the system defined maximum length. |
DeleteDirectory(DirectoryEntry)
Deletes an empty directory.
Declaration
public override bool DeleteDirectory(DirectoryEntry aPath)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aPath | The full path. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE on success. |
Overrides
| Improve this Doc View SourceDeleteFile(DirectoryEntry)
Deletes a file.
Declaration
public override bool DeleteFile(DirectoryEntry aPath)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aPath | The full path. |
Returns
Type | Description |
---|---|
System.Boolean | TRUE on success. |
Overrides
| Improve this Doc View SourceGetAvailableFreeSpace(String)
Get available free space.
Declaration
public override long GetAvailableFreeSpace(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id to get the size of. |
Returns
Type | Description |
---|---|
System.Int64 | long value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |
GetDirectory(String)
Gets the directory entry for a directory.
Declaration
public override DirectoryEntry GetDirectory(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path path. |
Returns
Type | Description |
---|---|
DirectoryEntry | A directory entry for the directory. |
Overrides
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when the entry at aPath is not a directory. |
GetDirectoryListing(DirectoryEntry)
Gets the directory listing for a directory entry.
Declaration
public override List<DirectoryEntry> GetDirectoryListing(DirectoryEntry aDirectory)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aDirectory | The directory entry. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DirectoryEntry> | DirectoryEntry type list value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
System.OverflowException |
|
System.Exception |
|
GetDirectoryListing(String)
Gets the directory listing for a path.
Declaration
public override List<DirectoryEntry> GetDirectoryListing(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path. |
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DirectoryEntry> | DirectoryEntry list value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
System.OverflowException |
|
System.Exception |
|
GetDisks()
Declaration
public override List<Disk> GetDisks()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<Disk> |
Overrides
| Improve this Doc View SourceGetFile(String)
Gets the directory entry for a file.
Declaration
public override DirectoryEntry GetFile(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path. |
Returns
Type | Description |
---|---|
DirectoryEntry | A directory entry for the file. |
Overrides
Exceptions
Type | Condition |
---|---|
System.Exception | Thrown when the entry at aPath is not a file. |
GetFileAttributes(String)
Gets the attributes for a File / Directory.
Declaration
public override FileAttributes GetFileAttributes(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The path of the File / Directory. |
Returns
Type | Description |
---|---|
System.IO.FileAttributes | The File / Directory attributes. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException |
|
System.ArgumentNullException |
|
System.ArgumentOutOfRangeException |
|
System.OverflowException |
|
System.Exception |
|
GetFileSystemLabel(String)
Get file system label.
Declaration
public override string GetFileSystemLabel(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
Returns
Type | Description |
---|---|
System.String | string value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |
GetFileSystemType(String)
Get file system type.
Declaration
public override string GetFileSystemType(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
Returns
Type | Description |
---|---|
System.String | string value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |
GetNextFilesystemLetter()
Declaration
public override string GetNextFilesystemLetter()
Returns
Type | Description |
---|---|
System.String |
Overrides
| Improve this Doc View SourceGetTotalFreeSpace(String)
Get total free space.
Declaration
public override long GetTotalFreeSpace(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id to get the size of. |
Returns
Type | Description |
---|---|
System.Int64 | long value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |
GetTotalSize(String)
Get total size in bytes.
Declaration
public override long GetTotalSize(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id to get the size of. |
Returns
Type | Description |
---|---|
System.Int64 | long value. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |
GetVolume(String)
Gets the directory entry for a volume.
Declaration
public override DirectoryEntry GetVolume(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The volume root path. |
Returns
Type | Description |
---|---|
DirectoryEntry | A directory entry for the volume. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aPath is null or empty. |
System.Exception | Unable to determine filesystem for path: + aPath |
System.ArgumentNullException | Thrown if filesystem is null. |
System.ArgumentOutOfRangeException | Thrown when root directory address is smaller then root directory address. |
GetVolumes()
Gets the volumes for all registered file systems.
Declaration
public override List<DirectoryEntry> GetVolumes()
Returns
Type | Description |
---|---|
System.Collections.Generic.List<DirectoryEntry> | A list of directory entries for all volumes. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentNullException | Thrown if filesystem is null. |
System.ArgumentOutOfRangeException | Thrown when root directory address is smaller then root directory address. |
System.ArgumentException | Thrown when root path is null or empty. |
Initialize(Boolean)
Initializes the virtual file system.
Declaration
public override void Initialize(bool aShowInfo)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | aShowInfo |
Overrides
Exceptions
Type | Condition |
---|---|
System.IO.IOException | Thrown on I/O exception. |
System.ArgumentNullException | Thrown on memory error. |
System.OverflowException | Thrown on memory error. |
System.Exception | Thrown on memory error. |
System.ArgumentException | Thrown on memory error. |
System.ArgumentOutOfRangeException | Thrown on memory error. |
System.IO.PathTooLongException | Thrown on fatal error. |
System.IO.FileNotFoundException | Thrown on memory error. |
System.IO.DirectoryNotFoundException | Thrown on fatal error. |
InitializePartitions()
Mounts filesystems.
Declaration
protected virtual void InitializePartitions()
IsValidDriveId(String)
Verifies if driveId is a valid id for a drive.
Declaration
public override bool IsValidDriveId(string driveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | driveId | The id of the drive. |
Returns
Type | Description |
---|---|
System.Boolean | true if the drive id is valid, false otherwise. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentOutOfRangeException | Thrown if driveId length is smaller then 2, or greater than Int32.MaxValue. |
SetFileAttributes(String, FileAttributes)
Sets the attributes for a File / Directory. Not implemented.
Declaration
public override void SetFileAttributes(string aPath, FileAttributes fileAttributes)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The path of the File / Directory. |
System.IO.FileAttributes | fileAttributes | The attributes of the File / Directory. |
Overrides
Exceptions
Type | Condition |
---|---|
System.NotImplementedException | Thrown always |
SetFileSystemLabel(String, String)
Set file system type.
Declaration
public override void SetFileSystemLabel(string aDriveId, string aLabel)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
System.String | aLabel | A label to be set. |
Overrides
Exceptions
Type | Condition |
---|---|
System.ArgumentException | Thrown when aDriveId is null or empty. |
System.Exception | Unable to determine filesystem for path: + aDriveId |