lamfat 0.4.1

no_std read/write FAT12/16/32 filesystem library (republish of fatfs)
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use std::{
    env,
    fs::File,
    io::{self, prelude::*},
};

use lamfat::{FileSystem, FsOptions};

fn main() -> io::Result<()> {
    let file = File::open("resources/fat32.img")?;
    let fs = FileSystem::new(file, FsOptions::new())?;
    let root_dir = fs.root_dir();
    let mut file = root_dir.open_file(&env::args().nth(1).expect("filename expected"))?;
    let mut buf = vec![];
    file.read_to_end(&mut buf)?;
    print!("{}", String::from_utf8_lossy(&buf));
    Ok(())
}