Skip to main content

IDriveProvider Interface

NuGet: GHIElectronics.TinyCLR.IO
Assembly: GHIElectronics.TinyCLR.IO
Namespace: GHIElectronics.TinyCLR.IO

Backing store for a mounted drive that the IO library calls into.

public interface IDriveProvider

Properties

DriveType

DriveType DriveType { get; }

The type of the drive.

DriveFormat

string DriveFormat { get; }

The name of the file system format on the drive.

IsReady

bool IsReady { get; }

Whether the drive is ready for access.

AvailableFreeSpace

long AvailableFreeSpace { get; }

The amount of free space available on the drive in bytes.

TotalFreeSpace

long TotalFreeSpace { get; }

The total free space on the drive in bytes.

TotalSize

long TotalSize { get; }

The total size of the drive in bytes.

VolumeLabel

string VolumeLabel { get; }

The volume label of the drive.

Name

string Name { get; }

The root name assigned to the drive.

Methods

Find(string path, string searchPattern)

IFileSystemEntryFinder Find(string path, string searchPattern)

Returns a finder for the entries under the path that match the search pattern.

Returns IFileSystemEntryFinder

GetFileSystemEntry(string path)

FileSystemEntry GetFileSystemEntry(string path)

Returns metadata for the entry at the path, or null if it does not exist.

Returns FileSystemEntry

OpenFile(string path, int bufferSize)

IFileStream OpenFile(string path, int bufferSize)

Opens the file at the path and returns a stream to it.

Returns IFileStream

Delete(string path)

void Delete(string path)

Deletes the file or directory at the path.

Move(string source, string destination)

bool Move(string source, string destination)

Moves an entry from the source path to the destination path.

Returns bool

CreateDirectory(string path)

void CreateDirectory(string path)

Creates a directory at the path.

GetAttributes(string path)

FileAttributes GetAttributes(string path)

Returns the attributes of the entry at the path.

Returns FileAttributes

SetAttributes(string path, FileAttributes attributes)

void SetAttributes(string path, FileAttributes attributes)

Sets the attributes of the entry at the path.

Initialize(string name)

void Initialize(string name)

Initializes the provider with the given root name.