lamfat
A no_std FAT12/16/32 filesystem library — read and write — for embedded and
UEFI-bootloader contexts that need to read a kernel (or write a config) on a FAT
volume without a userspace filesystem stack.
Faithful republish of rafalh/rust-fatfs.
See PROVENANCE.md
for the exact upstream commit and the full list of changes from upstream.
What it does
Given any seekable byte source (IoBase + Read + Write + Seek) holding a FAT
volume:
- Mounts the volume and exposes the root directory.
- Reads and writes files; creates and removes files and directories.
- Handles FAT12, FAT16, and FAT32, short (8.3) and long file names (
lfn).
It is the same battle-tested fatfs engine, repackaged under a distinct crate
name so it can be a published dependency of the LamBoot bootloader family and
packaged for Debian/Fedora. The on-disk format logic is unchanged from upstream.
Usage sketch
use ;
// `disk` is anything implementing lamfat's IoBase + Read + Write + Seek over the
// FAT volume's bytes — a block device, a partition, or (with the std feature) a
// file wrapped in a buffering stream.
Complete examples (ls, cat, write, mkfatfs, partition) are in the
examples/ directory.
Features
std— enablestd::iointegration (off by default; the crate isno_std).alloc— long-filename and format paths that need allocation.lfn— long file name (VFAT) support.unicode— full Unicode case handling for file names.log_level_error/_warn/_info— compile-time log verbosity ceilings.
chrono (timestamps) is available as an opt-in dependency but is off by
default, so the default dependency tree is just bitflags + log.
no_std
Set default-features = false for no_std operation. alloc is required for
long file names and formatting; the core read path works without it.
License
MIT. See LICENSE-MIT. Original copyright held by Rafał Harabień
(2017); republish-level modifications copyright Lamco Development LLC (2026). See
NOTICE and PROVENANCE.md.