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.
dotnet add package LTRData.DiscUtils.Fat| Capability | Support |
|---|---|
| Read files and directories | Yes |
| Create / format a filesystem | Yes |
| Modify files and directories | Yes, with a writable backing stream |
Includes floppy and partition formatting. Select FormatPartition for a partition or FormatFloppy for a floppy image. FAT variant, capacity and geometry constraints apply.
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.
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!");Repository and capability matrix · Wiki · Migration guide · Format registration and Native AOT