buf-fs 0.1.3

A buffer based, in-memory filesystem.
Documentation
# buf-fs

[![crates.io](https://img.shields.io/crates/v/buf-fs?label=latest)](https://crates.io/crates/buf-fs)
[![Documentation](https://docs.rs/buf-fs/badge.svg)](https://docs.rs/buf-fs/)
[![License](https://img.shields.io/crates/l/buf-fs.svg)]()

A buffer based, in-memory, `no_std` filesystem.

This crate mimics a file system, operating entirely within memory. By establishing a Fat (File Allocation Table) partition within a byte buffer, it exposes an API resembling that of a traditional filesystem to its users.

### Example

```rust
use buf_fs::FileSystem;

let size = 4 * 1024 * 1024;
let mut fs = FileSystem::new(size).unwrap();

let data = b"foo";

fs.mkdir("/var/share/baz").unwrap();

fs.open("/var/share/data.bin")
    .unwrap()
    .update(|b| b.extend(data))
    .save(&mut fs)
    .unwrap();

fs.open("/var/share/bar.bin")
    .unwrap()
    .update(|b| b.extend(data))
    .save(&mut fs)
    .unwrap();

assert_eq!(fs.open("/var/share/data.bin").unwrap().contents, data);

let contents = fs.ls("/var/share").unwrap();

assert_eq!(contents.len(), 3);

// FAT-16 is always uppercase.
// It's a TODO to support ext4
assert_eq!(contents[0].path().as_str(), "BAZ");
assert_eq!(contents[1].path().as_str(), "BAR.BIN");
assert_eq!(contents[2].path().as_str(), "DATA.BIN");
```