Interface IAbsoluteFilePath
Represents an absolute path to a file.
Inherited Members
Namespace: Singulink.IO
Assembly: Singulink.IO.FileSystem.dll
Syntax
[TypeConverter(typeof(AbsoluteFilePathConverter))]
[JsonConverter(typeof(AbsoluteFilePathJsonConverter))]
public interface IAbsoluteFilePath : IAbsolutePath, IFilePath, IPath, IEquatable<IPath?>
Properties
| Name | Description |
|---|---|
| IsReadOnly | Gets or sets a value indicating whether the file is read-only. |
| Length | Gets the size of the file in bytes. |
| ParentDirectory | Gets the file's parent directory. |
Methods
| Name | Description |
|---|---|
| AddExtension(string?, PathOptions) | Adds a single extension to the file name, preserving any existing extensions before it. |
| AddMultiExtension(string?, PathOptions) | Adds a multi-extension, which has one or more parts (e.g. |
| CopyTo(IAbsoluteFilePath, bool) | Copies the file to a new file, optionally allowing the overwriting of an existing file. |
| Delete(bool) | Deletes the file. |
| FlushToDisk(bool) | Flushes the file's data and metadata to disk, so that they survive a power loss or an operating system crash. |
| GetInfo() | Gets information about this file. |
| MoveTo(IAbsoluteFilePath, bool) | Moves the file to a new location, optionally allowing the overwriting of an existing file. |
| MoveToExclusive(IAbsoluteFilePath, bool) | Moves the file to a new location on the same volume in such a way that, of several attempts to move the same file at the same time, at most one succeeds. |
| OpenAsyncHandle(FileMode, FileAccess, FileShare, FileOptions, long) | Opens an asynchronous handle to a new or existing file, for use with the methods of RandomAccess (the Asynchronous option is always appended). |
| OpenAsyncStream(FileMode, FileAccess, FileShare, int, FileOptions) | Opens an asynchronous file stream to a new or existing file (the Asynchronous option is always appended). |
| OpenHandle(FileMode, FileAccess, FileShare, FileOptions, long) | Opens a handle to a new or existing file, for use with the methods of RandomAccess. |
| OpenStream(FileMode, FileAccess, FileShare, int, FileOptions) | Opens a file stream to a new or existing file. |
| RemoveExtension(string, PathOptions) | Removes the specified single extension, which is the last extension of the file name. Case is ignored on every platform. |
| RemoveMultiExtension(string, PathOptions) | Removes the specified multi-extension, which has one or more parts (e.g. |
| Replace(IAbsoluteFilePath, IAbsoluteFilePath?, bool) | Replaces the contents of a file with the current file, deleting the original file and optionally creating a backup of the replaced file. |
| WithExtension(string?, PathOptions) | Changes the last extension of the file name to a new single extension. |
Explicit Interface Implementations
| Name | Description |
|---|---|
| IAbsolutePath.GetInfo() | Gets information about this file/directory. |
| IFilePath.AddExtension(string?, PathOptions) | Adds a single extension to the file name, preserving any existing extensions before it. |
| IFilePath.AddMultiExtension(string?, PathOptions) | Adds a multi-extension, which has one or more parts (e.g. |
| IFilePath.RemoveExtension(string, PathOptions) | Removes the specified single extension, which is the last extension of the file name. Case is ignored on every platform. |
| IFilePath.RemoveMultiExtension(string, PathOptions) | Removes the specified multi-extension, which has one or more parts (e.g. |
| IFilePath.WithExtension(string?, PathOptions) | Changes the last extension of the file name to a new single extension. |