Crates.io | fat32rs |
lib.rs | fat32rs |
version | 0.0.1 |
created_at | 2025-08-15 18:02:49.789568+00 |
updated_at | 2025-08-15 18:02:49.789568+00 |
description | Minimal FAT32 client written in #[no_std] Rust. |
homepage | https://github.com/careyi3/fat32rs |
repository | https://github.com/careyi3/fat32rs |
max_upload_size | |
id | 1797255 |
size | 67,168,080 |
Minimal FAT32 client written in #[no_std] Rust.
This is library was designed to operate within some specific constraints imposed by running in an embedded systems environment.
Based on this original Python prototype: fat32py
*The following instructions assumes a Linux or Mac environment
The only features implemented are:
All you should need is a working dev environment for Rust with Cargo installed. You can find instructions here.
To run the examples simply run the below:
$ cargo run --example print_files
Note: If you want to read from your own physical drive, you can pass an argument like /dev/diskn
which will run against your physical drive.
$ cargo run --example print_files /dev/disk4
I recommend using an SDCard. If you plug one into you system, you can see the name for it by listing all the files in your /dev
directory:
$ cd /dev
$ ls
You can run tests by running:
$ cargo test
This will use a 64MB .img
drive preloaded with test files which you can find at ./tests/data/drive.img
.
$ cd ./tests/data
This will create an empty .dmg
image formatted for FAT32 with the volume name DRIVE
.
$ sudo hdiutil create -size 64m -fs FAT32 -layout MBRSPUD -volname DRIVE ./drive.dmg
This will create an empty .dmg
image formatted for FAT32 with the volume name DRIVE
.
$ hdiutil convert drive.dmg -format UDRW -o drive.img
$ hdiutil attach drive.img
/dev/disk6 FDisk_partition_scheme
/dev/disk6s1 DOS_FAT_32 /Volumes/DRIVE
# this output you will need for the next step, will be different for your system
$ open /Volumes/DRIVE
You can now use the disk as normal. If you are using the drive committed in this repo, you will notice it has two files LOG-1
and LOG-2
. These are used by the tests. However, you can add or modify the drive as you like, just make sure to update the tests!