GitPedia

Simple fatfs

A simple-to-use FAT filesystem library for Rust (mainly targeted at embedded systems)

From Oakchris1955·Updated June 27, 2026·View on GitHub·

A simple-to-use filesystem driver for the File Allocation Table (FAT) The project is written primarily in Rust, distributed under the MIT License license, first published in 2024. Key topics include: embedded, fat, fatfs, rust.

simple-fatfs

CI Status
GitHub License
Crates.io Version
docs.rs
Crates.io MSRV

A simple-to-use filesystem driver for the File Allocation Table (FAT)

Motive

Apart from rafalh's rust-fatfs library, there aren't actually any other FAT filesystem drivers in crates.io. All the other libraries either support only FAT16/32, aren't being actively developed or are just bindings to some C library.

Another thing I found somewhat frustrating about rafalh's rust-fatfs (which ultimately led to my decision of creating this project) is the fact that his library isn't suitable for embedded Rust, since it requires implementing some weird kind of buffered Read/Write, while it is also worth mentioning that the crates.io version of his library is somewhat outdated (there have been 144 additional commits as of the time I'm writing this).

Intent

A fully-working FAT driver that covers the following criteria:

  • An easy-to-use public API for developers
  • Avoids unnecessary/overbloated dependencies (I am talking about leftpad-like dependencies)
  • #[no_std] support
  • FAT12/16/32/ExFAT support
  • VFAT/LFN (long filename) support

It also aims to be able to do the following in the future:

  • Allow low-level manipulation of a FAT filesystem (e.g. for checking if a file is continuous)
  • Features enabling/disabling perhaps unnecessary features for certain use cases,
    allowing for usage in devices with limited flash memory / RAM

TODO

  • Handle non-printable characters in names of files and directories
  • ExFAT support
  • handle duplicate file open, either by blocking or more preferably, by not allowing such behavior.
  • proper codepage logic (support for multi-byte codepages, allow the user to use their own if it isn't already supported, etc.)
  • proper testing suite (the current tests.rs file is a mess)

Known issues

  • Duplicate file opens or in general any write operation involving a file that
    is open either as R/W or RO could cause data corruption (see #14)

  • Multi-byte codepages, such as the Japanese one (932) are currently unsupported.

Acknowledgments

I'd like to thank @alexkazik for his contributions, most importantly his short filename generation algorithm and his Block-based device traits.

I'd also like to thank @lukaslihotzki for migrating the library away from the now-abandonded bincode to zerocopy and making simple-fatfs endian-agnostic.

This project adheres to Keep a Changelog and Conventional Commits (since commit 21c7d6b, that is excluding the first two commits which don't actually contain any code). It also uses git-cliff to parse commit messages into a CHANGELOG

License

MIT

Contributors

Showing top 6 contributors by commit count.

View all contributors on GitHub →

This article is auto-generated from Oakchris1955/simple-fatfs via the GitHub API.Last fetched: 6/28/2026