Class VFSManager
VFSManager (Virtual File System Manager) class. Used to manage files and directories.
Inheritance
Namespace: Cosmos.System.FileSystem.VFS
Assembly: Cosmos.System2.dll
Syntax
public static class VFSManager : object
Methods
| Improve this Doc View SourceCreateDirectory(String)
Create directory.
Declaration
public static DirectoryEntry CreateDirectory(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the directory. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
CreateFile(String)
Create a file.
Declaration
public static DirectoryEntry CreateFile(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the file. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
DeleteDirectory(String, Boolean)
Delete directory.
Declaration
public static void DeleteDirectory(string aPath, bool recursive)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the directory. |
System.Boolean | recursive | Recursive delete (not empty directory). |
DeleteFile(String)
Delete a file.
Declaration
public static void DeleteFile(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the file. |
DirectoryExists(DirectoryEntry)
Check if directory exists.
Declaration
public static bool DirectoryExists(DirectoryEntry aEntry)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aEntry | A entry of the directory. |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
DirectoryExists(String)
Check if directory exists.
Declaration
public static bool DirectoryExists(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the directory. |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
FileExists(DirectoryEntry)
Check if file exists.
Declaration
public static bool FileExists(DirectoryEntry aEntry)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aEntry | A entry of the file. |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
FileExists(String)
Check if file exists.
Declaration
public static bool FileExists(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the file. |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
Format(String, String, Boolean)
Format partition.
Declaration
public static void Format(string aDriveId, string aDriveFormat, bool aQuick)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
System.String | aDriveFormat | A drive format. |
System.Boolean | aQuick | Quick format. |
GetAltDirectorySeparatorChar()
Get alt. directory separator char.
Declaration
public static char GetAltDirectorySeparatorChar()
Returns
Type | Description |
---|---|
System.Char | char value. |
GetAvailableFreeSpace(String)
Get available free space.
Declaration
public static 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. |
GetDirectory(String)
Get directory.
Declaration
public static DirectoryEntry GetDirectory(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the directory. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
GetDirectoryListing(String)
Get directory listing.
Declaration
public static List<DirectoryEntry> GetDirectoryListing(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the entry. |
Returns
Type | Description |
---|---|
List<DirectoryEntry> | DirectoryEntry list value. |
GetDirectorySeparatorChar()
Get directory separator char.
Declaration
public static char GetDirectorySeparatorChar()
Returns
Type | Description |
---|---|
System.Char | char value. |
GetFile(String)
Get file.
Declaration
public static DirectoryEntry GetFile(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the file. |
Returns
Type | Description |
---|---|
DirectoryEntry | DirectoryEntry value. |
GetFileAttributes(String)
Get file attributes.
Declaration
public static FileAttributes GetFileAttributes(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to the file |
Returns
Type | Description |
---|---|
FileAttributes | FileAttributes value. |
GetFileStream(String)
Get file stream.
Declaration
public static Stream GetFileStream(string aPathname)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPathname | A path to the file. |
Returns
Type | Description |
---|---|
Stream | Stream value. |
GetFileSystemLabel(String)
Get file system label.
Declaration
public static string GetFileSystemLabel(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
Returns
Type | Description |
---|---|
System.String | string value. |
GetFileSystemType(String)
Get file system type.
Declaration
public static string GetFileSystemType(string aDriveId)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
Returns
Type | Description |
---|---|
System.String | string value. |
GetFullPath(DirectoryEntry)
Get full path to the entry.
Declaration
public static string GetFullPath(DirectoryEntry aEntry)
Parameters
Type | Name | Description |
---|---|---|
DirectoryEntry | aEntry | A entry. |
Returns
Type | Description |
---|---|
System.String | string value. |
GetInvalidFileNameChars()
Get invalid filename chars.
Declaration
public static char[] GetInvalidFileNameChars()
Returns
Type | Description |
---|---|
System.Char[] | char array value. |
GetInvalidPathCharsWithAdditionalChecks()
Get invalid path chars with additional checks.
Declaration
public static char[] GetInvalidPathCharsWithAdditionalChecks()
Returns
Type | Description |
---|---|
System.Char[] | char array value. |
GetLogicalDrives()
Get logical drivers list.
Declaration
public static List<string> GetLogicalDrives()
Returns
Type | Description |
---|---|
List<System.String> | List of strings value. |
GetMaxPath()
Get max path.
Declaration
public static int GetMaxPath()
Returns
Type | Description |
---|---|
System.Int32 | int value. |
GetParent(String)
Gets the parent directory entry from the path.
Declaration
public static DirectoryEntry GetParent(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The full path to the current directory entry. |
Returns
Type | Description |
---|---|
DirectoryEntry | The parent directory entry. |
GetPathSeparator()
Get path separator char.
Declaration
public static char GetPathSeparator()
Returns
Type | Description |
---|---|
System.Char | char value. |
GetRealInvalidPathChars()
Get real invalid path chars.
Declaration
public static char[] GetRealInvalidPathChars()
Returns
Type | Description |
---|---|
System.Char[] | char array value. |
GetTotalFreeSpace(String)
Get total free space.
Declaration
public static 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. |
GetTotalSize(String)
Get total size in bytes.
Declaration
public static 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. |
GetTrimEndChars()
Get trim end chars.
Declaration
public static char[] GetTrimEndChars()
Returns
Type | Description |
---|---|
System.Char[] | char array value. |
GetVolume(String)
Get volume.
Declaration
public static DirectoryEntry GetVolume(string aVolume)
Parameters
Type | Name | Description |
---|---|---|
System.String | aVolume | The volume root path. |
Returns
Type | Description |
---|---|
DirectoryEntry | A directory entry for the volume. |
GetVolumes()
Gets the volumes for all registered file systems.
Declaration
public static List<DirectoryEntry> GetVolumes()
Returns
Type | Description |
---|---|
List<DirectoryEntry> | A list of directory entries for all volumes. |
GetVolumeSeparatorChar()
Get volume separator char.
Declaration
public static char GetVolumeSeparatorChar()
Returns
Type | Description |
---|---|
System.Char | char value. |
IsValidDriveId(String)
Check if drive id is valid.
Declaration
public static bool IsValidDriveId(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath |
Returns
Type | Description |
---|---|
System.Boolean | bool value. |
RegisterFileSystem(FileSystemFactory)
Register file system.
Declaration
public static void RegisterFileSystem(FileSystemFactory aFileSystemFactory)
Parameters
Type | Name | Description |
---|---|---|
FileSystemFactory | aFileSystemFactory | A file system to register. |
RegisterVFS(VFSBase, Boolean)
Register VFS. Initialize the VFS.
Declaration
public static void RegisterVFS(VFSBase aVFS, bool aAllowReinitialise = false)
Parameters
Type | Name | Description |
---|---|---|
VFSBase | aVFS | A VFS to register. |
System.Boolean | aAllowReinitialise |
SetFileAttributes(String, FileAttributes)
Sets the attributes for a File / Directory. Not implemented.
Declaration
public static void SetFileAttributes(string aPath, FileAttributes fileAttributes)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | The path of the File / Directory. |
FileAttributes | fileAttributes | The attributes of the File / Directory. |
SetFileSystemLabel(String, String)
Set file system type.
Declaration
public static void SetFileSystemLabel(string aDriveId, string aLabel)
Parameters
Type | Name | Description |
---|---|---|
System.String | aDriveId | A drive id. |
System.String | aLabel | A label to be set. |
SplitPath(String)
Split path.
Declaration
public static string[] SplitPath(string aPath)
Parameters
Type | Name | Description |
---|---|---|
System.String | aPath | A path to split. |
Returns
Type | Description |
---|---|
System.String[] | string array. |