2017-09-23 04:36:51 +08:00
|
|
|
Rust FAT
|
|
|
|
========
|
|
|
|
|
2017-09-27 20:21:01 +08:00
|
|
|
[![Travis Build Status](https://travis-ci.org/rafalh/rust-fat.svg?branch=master)](https://travis-ci.org/rafalh/rust-fat)
|
2017-10-11 06:57:31 +08:00
|
|
|
[![MIT licensed](https://img.shields.io/badge/license-MIT-blue.svg)](./LICENSE.txt)
|
|
|
|
[![crates.io](http://meritbadge.herokuapp.com/fatfs)](https://crates.io/crates/fatfs)
|
|
|
|
[![Documentation](https://docs.rs/fatfs/badge.svg)](https://docs.rs/fatfs)
|
2017-09-27 20:21:01 +08:00
|
|
|
|
2017-10-10 03:14:28 +08:00
|
|
|
FAT filesystem library implemented in Rust.
|
2017-09-24 20:34:07 +08:00
|
|
|
|
2017-09-25 04:12:38 +08:00
|
|
|
Features:
|
2017-11-08 08:35:47 +08:00
|
|
|
* read/write/create/remove file,
|
|
|
|
* enumerate directory children,
|
|
|
|
* create/remove directory,
|
|
|
|
* read/write file timestamps (updated automatically if chrono is available),
|
2017-10-21 22:25:04 +08:00
|
|
|
* FAT12, FAT16, FAT32 compatibility,
|
|
|
|
* LFN (Long File Names) extension supported.
|
2017-09-25 04:12:38 +08:00
|
|
|
|
2017-11-08 08:35:47 +08:00
|
|
|
Example
|
|
|
|
=======
|
|
|
|
|
|
|
|
let file = File::open("fat.img").unwrap();
|
|
|
|
let mut buf_rdr = BufStream::new(file);
|
|
|
|
let fs = FileSystem::new(&mut buf_rdr, true).unwrap();
|
|
|
|
let mut root_dir = fs.root_dir();
|
|
|
|
let mut file = root_dir.create_file("hello.txt").unwrap();
|
|
|
|
file.write_all(b"Hello World!").unwrap();
|
|
|
|
|
|
|
|
See more examples in `examples` subdirectory.
|
2017-09-23 04:36:51 +08:00
|
|
|
|
|
|
|
License
|
|
|
|
-------
|
|
|
|
The MIT license. See LICENSE.txt.
|