Skip to main content

FileSystem Class

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

Mounts and unmounts file systems on top of a GHIElectronics.TinyCLR.Devices.Storage.StorageController. Pass the controller's Hdc to Mount(IntPtr) to make its content accessible via System.IO.File / System.IO.Directory.

public static class FileSystem

Methods

Mount(IntPtr hdc)

public static IDriveProvider Mount(IntPtr hdc)

Mounts the file system on the storage controller handle and returns its drive provider.

Returns IDriveProvider

Unmount(IntPtr hdc)

public static bool Unmount(IntPtr hdc)

Unmounts the file system on the storage controller handle.

Returns bool

Flush(IntPtr hdc)

public static void Flush(IntPtr hdc)

Flushes all pending writes for the file system on the storage controller handle.

Format(IntPtr hdc, string volume, uint parameter, byte forceSize)

public static bool Format(IntPtr hdc, string volume = null, uint parameter = 0, byte forceSize = 0)

Formats the volume on the storage controller handle, optionally over only part of the volume.

Returns bool