Skip to content

Latest commit

 

History

History
56 lines (37 loc) · 2.21 KB

File metadata and controls

56 lines (37 loc) · 2.21 KB

LTRData.DiscUtils.Fat

Managed .NET implementation for reading, formatting and modifying FAT12, FAT16 and FAT32 filesystems.

Part of the LTRData DiscUtils fork. Package IDs use LTRData.DiscUtils; C# namespaces remain DiscUtils.

Installation

dotnet add package LTRData.DiscUtils.Fat

Capabilities

Capability Support
Read files and directories Yes
Create / format a filesystem Yes
Modify files and directories Yes, with a writable backing stream

Usage notes

Includes floppy and partition formatting. Select FormatPartition for a partition or FormatFloppy for a floppy image. FAT variant, capacity and geometry constraints apply.

Registration

For automatic discovery, register the providers implemented by this package:

DiscUtils.Fat.Formats.Register();

Direct use of the concrete APIs in this package does not require discovery registration. Each registration call covers only its own assembly. Register DiscUtils.Core.Formats.Register() as well when using generic disk opening through the local-file transport, and register other disk/filesystem providers as needed. These registration calls support trimming and Native AOT; this is not a guarantee for every operation in the package.

Example

using System.IO;
using DiscUtils;
using DiscUtils.Fat;

using var image = File.Create("floppy.vfd");
using var fs = FatFileSystem.FormatFloppy(image, FloppyDiskType.HighDensity, "MY FLOPPY  ");
using var file = fs.OpenFile("hello.txt", FileMode.Create, FileAccess.Write);
using var writer = new StreamWriter(file);
writer.WriteLine("Hello from DiscUtils!");

Related packages

Documentation

Repository and capability matrix · Wiki · Migration guide · Format registration and Native AOT