IFileSystemType
PackageAxial.FileSystem
Provides access to common file, directory, and path operations.
Specification
Kind
Type
Members
98
Examples
0
AppendAllLinesSignature
this.AppendAllLines
AppendAllLinesSignature
this.AppendAllLines
AppendAllTextSignature
this.AppendAllText
AppendAllTextSignature
this.AppendAllText
AppendAllTextAsyncSignature
this.AppendAllTextAsync
Summary
| Name | Signature | Synopsis |
|---|---|---|
| AppendAllLines | this.AppendAllLines | Appends lines to a file with the specified encoding, creating the file if needed. |
| AppendAllLines | this.AppendAllLines | Appends lines to a file, creating the file if needed. |
| AppendAllText | this.AppendAllText | Appends text to a file with the specified encoding, creating the file if needed. |
| AppendAllText | this.AppendAllText | Appends text to a file, creating the file if needed. |
| AppendAllTextAsync | this.AppendAllTextAsync | Asynchronously appends text to a file, creating the file if needed. |
| AppendText | this.AppendText | Opens a UTF-8 text writer that appends to a file, creating the file if needed. |
| ChangeExtension | this.ChangeExtension | Changes the extension of a path. |
| Combine | this.Combine | Combines path segments into one path. |
| CopyFile | this.CopyFile | Copies a file to a destination path. |
| CreateDirectory | this.CreateDirectory | Creates a directory and any missing parent directories. |
| CreateDirectorySymbolicLink | this.CreateDirectorySymbolicLink | Creates a symbolic link to a directory. |
| CreateFile | this.CreateFile | Creates or overwrites a file and returns the open stream. |
| CreateFileSymbolicLink | this.CreateFileSymbolicLink | Creates a symbolic link to a file. |
| CreateText | this.CreateText | Creates or overwrites a UTF-8 text file and returns the open writer. |
| DeleteDirectory | this.DeleteDirectory | Deletes a directory. |
| DeleteFile | this.DeleteFile | Deletes the specified file if it exists. |
| DirectoryExists | this.DirectoryExists | Determines whether the specified directory exists. |
| EndsInDirectorySeparator | this.EndsInDirectorySeparator | Returns whether a path ends in a directory separator. |
| EnumerateDirectories | this.EnumerateDirectories | Enumerates directories in a directory. |
| EnumerateFileSystemEntries | this.EnumerateFileSystemEntries | Enumerates files and directories in a directory. |
| EnumerateFiles | this.EnumerateFiles | Enumerates files in a directory. |
| FileExists | this.FileExists | Determines whether the specified file exists. |
| GetCurrentDirectory | this.GetCurrentDirectory | Gets the current working directory. |
| GetDirectories | this.GetDirectories | Gets directories in a directory. |
| GetDirectoryCreationTime | this.GetDirectoryCreationTime | Gets directory creation time. |
| GetDirectoryCreationTimeUtc | this.GetDirectoryCreationTimeUtc | Gets directory creation time in UTC. |
| GetDirectoryLastAccessTime | this.GetDirectoryLastAccessTime | Gets directory last access time. |
| GetDirectoryLastAccessTimeUtc | this.GetDirectoryLastAccessTimeUtc | Gets directory last access time in UTC. |
| GetDirectoryLastWriteTime | this.GetDirectoryLastWriteTime | Gets directory last write time. |
| GetDirectoryLastWriteTimeUtc | this.GetDirectoryLastWriteTimeUtc | Gets directory last write time in UTC. |
| GetDirectoryName | this.GetDirectoryName | Returns the directory name for a path. |
| GetDirectoryRoot | this.GetDirectoryRoot | Gets the root portion of a directory path. |
| GetExtension | this.GetExtension | Returns the extension for a path. |
| GetFileAttributes | this.GetFileAttributes | Gets file attributes. |
| GetFileCreationTime | this.GetFileCreationTime | Gets file creation time. |
| GetFileCreationTimeUtc | this.GetFileCreationTimeUtc | Gets file creation time in UTC. |
| GetFileLastAccessTime | this.GetFileLastAccessTime | Gets file last access time. |
| GetFileLastAccessTimeUtc | this.GetFileLastAccessTimeUtc | Gets file last access time in UTC. |
| GetFileLastWriteTime | this.GetFileLastWriteTime | Gets file last write time. |
| GetFileLastWriteTimeUtc | this.GetFileLastWriteTimeUtc | Gets file last write time in UTC. |
| GetFileName | this.GetFileName | Returns the file name for a path. |
| GetFileNameWithoutExtension | this.GetFileNameWithoutExtension | Returns the file name without extension for a path. |
| GetFileSystemEntries | this.GetFileSystemEntries | Gets files and directories in a directory. |
| GetFiles | this.GetFiles | Gets files in a directory. |
| GetFullPath | this.GetFullPath | Returns the full path for a path. |
| GetInvalidFileNameChars | this.GetInvalidFileNameChars | Returns invalid file-name characters for the platform. |
| GetInvalidPathChars | this.GetInvalidPathChars | Returns invalid path characters for the platform. |
| GetLogicalDrives | this.GetLogicalDrives | Gets logical drives for the current machine. |
| GetParent | this.GetParent | Gets the parent directory path. |
| GetPathRoot | this.GetPathRoot | Returns the root portion of a path. |
| GetRandomFileName | this.GetRandomFileName | Returns a random file or directory name. |
| GetRelativePath | this.GetRelativePath | Returns a path relative to another path. |
| GetSymbolicLinkTarget | this.GetSymbolicLinkTarget | Returns the immediate target stored in a symbolic link, or None when the path is not a link. |
| GetTempFileName | this.GetTempFileName | Creates a uniquely named zero-byte temporary file and returns its path. |
| GetTempPath | this.GetTempPath | Returns the temporary directory path. |
| HasExtension | this.HasExtension | Returns whether a path has an extension. |
| IsPathFullyQualified | this.IsPathFullyQualified | Returns whether a path is fully qualified. |
| IsPathRooted | this.IsPathRooted | Returns whether a path contains a root. |
| MoveDirectory | this.MoveDirectory | Moves a directory to a destination path. |
| MoveFile | this.MoveFile | Moves a file to a destination path. |
| OpenFile | this.OpenFile | Opens a file with the specified mode, access, and sharing behavior. |
| OpenFile | this.OpenFile | Opens a file with the specified mode and access. |
| OpenFile | this.OpenFile | Opens a file with the specified mode. |
| OpenRead | this.OpenRead | Opens an existing file for reading. |
| OpenText | this.OpenText | Opens an existing UTF-8 text file for reading. |
| OpenWrite | this.OpenWrite | Opens a file for writing, creating it if needed. |
| ReadAllBytes | this.ReadAllBytes | Opens a binary file, reads all bytes, and then closes the file. |
| ReadAllBytesAsync | this.ReadAllBytesAsync | Asynchronously opens a binary file, reads all bytes, and then closes the file. |
| ReadAllLines | this.ReadAllLines | Opens a text file with the specified encoding, reads all lines, and then closes the file. |
| ReadAllLines | this.ReadAllLines | Opens a text file, reads all lines, and then closes the file. |
| ReadAllLinesAsync | this.ReadAllLinesAsync | Asynchronously opens a text file, reads all lines, and then closes the file. |
| ReadAllText | this.ReadAllText | Opens a text file with the specified encoding, reads all text, and then closes the file. |
| ReadAllText | this.ReadAllText | Opens a text file, reads all text, and then closes the file. |
| ReadAllTextAsync | this.ReadAllTextAsync | Asynchronously opens a text file, reads all text, and then closes the file. |
| ResolveSymbolicLinkTarget | this.ResolveSymbolicLinkTarget | Resolves a symbolic link target and optionally follows the complete link chain. |
| SetCurrentDirectory | this.SetCurrentDirectory | Sets the current working directory. |
| SetDirectoryCreationTime | this.SetDirectoryCreationTime | Sets directory creation time. |
| SetDirectoryCreationTimeUtc | this.SetDirectoryCreationTimeUtc | Sets directory creation time in UTC. |
| SetDirectoryLastAccessTime | this.SetDirectoryLastAccessTime | Sets directory last access time. |
| SetDirectoryLastAccessTimeUtc | this.SetDirectoryLastAccessTimeUtc | Sets directory last access time in UTC. |
| SetDirectoryLastWriteTime | this.SetDirectoryLastWriteTime | Sets directory last write time. |
| SetDirectoryLastWriteTimeUtc | this.SetDirectoryLastWriteTimeUtc | Sets directory last write time in UTC. |
| SetFileAttributes | this.SetFileAttributes | Sets file attributes. |
| SetFileCreationTime | this.SetFileCreationTime | Sets file creation time. |
| SetFileCreationTimeUtc | this.SetFileCreationTimeUtc | Sets file creation time in UTC. |
| SetFileLastAccessTime | this.SetFileLastAccessTime | Sets file last access time. |
| SetFileLastAccessTimeUtc | this.SetFileLastAccessTimeUtc | Sets file last access time in UTC. |
| SetFileLastWriteTime | this.SetFileLastWriteTime | Sets file last write time. |
| SetFileLastWriteTimeUtc | this.SetFileLastWriteTimeUtc | Sets file last write time in UTC. |
| TrimEndingDirectorySeparator | this.TrimEndingDirectorySeparator | Trims one trailing directory separator from a path. |
| WriteAllBytes | this.WriteAllBytes | Creates or overwrites a binary file, writes all bytes, and then closes the file. |
| WriteAllBytesAsync | this.WriteAllBytesAsync | Asynchronously creates or overwrites a binary file, writes all bytes, and then closes the file. |
| WriteAllLines | this.WriteAllLines | Creates or overwrites a text file with the specified encoding, writes all lines, and then closes the file. |
| WriteAllLines | this.WriteAllLines | Creates or overwrites a text file, writes all lines, and then closes the file. |
| WriteAllLinesAsync | this.WriteAllLinesAsync | Asynchronously creates or overwrites a text file, writes all lines, and then closes the file. |
| WriteAllText | this.WriteAllText | Creates or overwrites a text file with the specified encoding, writes all text, and then closes the file. |
| WriteAllText | this.WriteAllText | Creates or overwrites a text file, writes all text, and then closes the file. |
| WriteAllTextAsync | this.WriteAllTextAsync | Asynchronously creates or overwrites a text file, writes all text, and then closes the file. |
Appends lines to a file with the specified encoding, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string seq | |
| encoding | Encoding |
Returns
unit
Appends lines to a file, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string seq |
Returns
unit
Appends text to a file with the specified encoding, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string | |
| encoding | Encoding |
Returns
unit
Appends text to a file, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string |
Returns
unit
Asynchronously appends text to a file, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string | |
| cancellationToken | CancellationToken |
Returns
Task
Opens a UTF-8 text writer that appends to a file, creating the file if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
StreamWriter
Changes the extension of a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| extension | string |
Returns
string
Combines path segments into one path.
Parameters
| Name | Type | Description |
|---|---|---|
| paths | string array |
Returns
string
Copies a file to a destination path.
Parameters
| Name | Type | Description |
|---|---|---|
| sourcePath | string | |
| destinationPath | string | |
| overwrite | bool |
Returns
unit
Creates a directory and any missing parent directories.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
unit
Creates a symbolic link to a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| linkPath | string | |
| targetPath | string |
Returns
unit
Creates or overwrites a file and returns the open stream.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
Stream
Creates a symbolic link to a file.
Parameters
| Name | Type | Description |
|---|---|---|
| linkPath | string | |
| targetPath | string |
Returns
unit
Creates or overwrites a UTF-8 text file and returns the open writer.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
StreamWriter
Deletes a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| recursive | bool |
Returns
unit
Deletes the specified file if it exists.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
unit
Determines whether the specified directory exists.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Returns whether a path ends in a directory separator.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Enumerates directories in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string seq
Enumerates files and directories in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string seq
Enumerates files in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string seq
Determines whether the specified file exists.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Gets directories in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string array
Gets directory creation time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets directory creation time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets directory last access time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets directory last access time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets directory last write time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets directory last write time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Returns the directory name for a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string option
Gets the root portion of a directory path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Returns the extension for a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Gets file attributes.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
FileAttributes
Gets file creation time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets file creation time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets file last access time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets file last access time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets file last write time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Gets file last write time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
DateTime
Returns the file name for a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Returns the file name without extension for a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Gets files and directories in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string array
Gets files in a directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| searchPattern | string | |
| searchOption | SearchOption |
Returns
string array
Returns the full path for a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Returns invalid file-name characters for the platform.
Returns
char array
Returns invalid path characters for the platform.
Returns
char array
Gets logical drives for the current machine.
Returns
string array
Gets the parent directory path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string option
Returns the root portion of a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string option
Returns a path relative to another path.
Parameters
| Name | Type | Description |
|---|---|---|
| relativeTo | string | |
| path | string |
Returns
string
Returns the immediate target stored in a symbolic link, or
None when the path is not a link.Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string option
Creates a uniquely named zero-byte temporary file and returns its path.
Returns
string
Returns whether a path has an extension.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Returns whether a path is fully qualified.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Returns whether a path contains a root.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
bool
Moves a directory to a destination path.
Parameters
| Name | Type | Description |
|---|---|---|
| sourcePath | string | |
| destinationPath | string |
Returns
unit
Moves a file to a destination path.
Parameters
| Name | Type | Description |
|---|---|---|
| sourcePath | string | |
| destinationPath | string | |
| overwrite | bool |
Returns
unit
Opens a file with the specified mode, access, and sharing behavior.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| mode | FileMode | |
| access | FileAccess | |
| share | FileShare |
Returns
FileStream
Opens a file with the specified mode and access.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| mode | FileMode | |
| access | FileAccess |
Returns
FileStream
Opens a file with the specified mode.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| mode | FileMode |
Returns
FileStream
Opens an existing file for reading.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
Stream
Opens an existing UTF-8 text file for reading.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
StreamReader
Opens a file for writing, creating it if needed.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
Stream
Opens a binary file, reads all bytes, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
byte array
Asynchronously opens a binary file, reads all bytes, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| cancellationToken | CancellationToken |
Returns
Task<byte array>
Opens a text file with the specified encoding, reads all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| encoding | Encoding |
Returns
string array
Opens a text file, reads all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string array
Asynchronously opens a text file, reads all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| cancellationToken | CancellationToken |
Returns
Task<string array>
Opens a text file with the specified encoding, reads all text, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| encoding | Encoding |
Returns
string
Opens a text file, reads all text, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Asynchronously opens a text file, reads all text, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| cancellationToken | CancellationToken |
Returns
Task<string>
Resolves a symbolic link target and optionally follows the complete link chain.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| returnFinalTarget | bool |
Returns
string option
Sets the current working directory.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
unit
Sets directory creation time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| creationTime | DateTime |
Returns
unit
Sets directory creation time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| creationTimeUtc | DateTime |
Returns
unit
Sets directory last access time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastAccessTime | DateTime |
Returns
unit
Sets directory last access time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastAccessTimeUtc | DateTime |
Returns
unit
Sets directory last write time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastWriteTime | DateTime |
Returns
unit
Sets directory last write time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastWriteTimeUtc | DateTime |
Returns
unit
Sets file attributes.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| attributes | FileAttributes |
Returns
unit
Sets file creation time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| creationTime | DateTime |
Returns
unit
Sets file creation time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| creationTimeUtc | DateTime |
Returns
unit
Sets file last access time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastAccessTime | DateTime |
Returns
unit
Sets file last access time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastAccessTimeUtc | DateTime |
Returns
unit
Sets file last write time.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastWriteTime | DateTime |
Returns
unit
Sets file last write time in UTC.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| lastWriteTimeUtc | DateTime |
Returns
unit
Trims one trailing directory separator from a path.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string |
Returns
string
Creates or overwrites a binary file, writes all bytes, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | byte array |
Returns
unit
Asynchronously creates or overwrites a binary file, writes all bytes, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | byte array | |
| cancellationToken | CancellationToken |
Returns
Task
Creates or overwrites a text file with the specified encoding, writes all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string seq | |
| encoding | Encoding |
Returns
unit
Creates or overwrites a text file, writes all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string seq |
Returns
unit
Asynchronously creates or overwrites a text file, writes all lines, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string seq | |
| cancellationToken | CancellationToken |
Returns
Task
Creates or overwrites a text file with the specified encoding, writes all text, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string | |
| encoding | Encoding |
Returns
unit
Creates or overwrites a text file, writes all text, and then closes the file.
Parameters
| Name | Type | Description |
|---|---|---|
| path | string | |
| contents | string |
Returns
unit

