Skip to content

IFS

Namespace: Shadop.Archmage.Sdk

File system abstraction for Archmage configuration loading.

public interface IFS

Reads all bytes from the specified file.

Byte[] ReadAllBytes(string path)

path String
The file path.

Byte[]
A byte array containing the contents of the file.

ReadAllBytesAsync(String, CancellationToken)

Section titled “ReadAllBytesAsync(String, CancellationToken)”

Asynchronously reads all bytes from the specified file.

Task<Byte[]> ReadAllBytesAsync(string path, CancellationToken cancellationToken)

path String
The file path.

cancellationToken CancellationToken
The token to monitor for cancellation requests.

Task<Byte[]>
A task that represents the asynchronous read operation, wrapping the file contents as a byte array.

Determines whether the specified file exists.

bool FileExists(string path)

path String
The file to check.

Boolean
true if the caller has the required permissions and path contains the name of an existing file; otherwise, false.

Determines whether the given path refers to an existing directory on disk.

bool DirectoryExists(string path)

path String
The path to test.

Boolean
true if path refers to an existing directory; false if the directory does not exist or an error occurs when trying to determine if the specified directory exists.