Skip to main content

DriveInfo Class

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

Information about a mounted volume — total/available space, type, root path.

public sealed class DriveInfo

Constructors

DriveInfo(string driveName)

public DriveInfo(string driveName)

Creates a new instance for the registered drive with the given root name.

Properties

Name

public string Name { get; }

The root name of the drive.

RootDirectory

public DirectoryInfo RootDirectory { get; }

The root directory of the drive.

DriveType

public DriveType DriveType { get; }

The type of the drive.

DriveFormat

public string DriveFormat { get; }

The name of the file system format on the drive.

IsReady

public bool IsReady { get; }

Whether the drive is ready for access.

AvailableFreeSpace

public long AvailableFreeSpace { get; }

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

TotalFreeSpace

public long TotalFreeSpace { get; }

The total free space on the drive in bytes.

TotalSize

public long TotalSize { get; }

The total size of the drive in bytes.

VolumeLabel

public string VolumeLabel { get; }

The volume label of the drive.

Methods

GetDrives()

public static DriveInfo[] GetDrives()

Returns information about all mounted drives.

Returns DriveInfo[]

RegisterDriveProvider(IDriveProvider provider)

public static IDriveProvider RegisterDriveProvider(IDriveProvider provider)

Assigns the next free root name to the provider and registers it as a drive.

Returns IDriveProvider

DeregisterDriveProvider(IDriveProvider provider)

public static void DeregisterDriveProvider(IDriveProvider provider)

Unregisters the provider and frees its root name.