flatfs 0.2.1

A readonly filesystem.
Documentation
  • Coverage
  • 8.33%
    1 out of 12 items documented0 out of 6 items with examples
  • Size
  • Source code size: 21.66 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 208.35 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 8s Average build duration of successful builds.
  • all releases: 8s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • Repository
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • lasiotus

flatfs

Flat Filesystem

What is it?

A simple way to package a small number of files into a single flat memory area. Like CPIO. [no-std]

Why?

Same reason why CPIO exists. I needed a way to easily create read-only partitions in Rust in 2023, and could not find a suitable and lightweight way to do it, so I rolled my own.

Goals

  • [no-std]
  • pack a small (~1k) number of "files" into a single contiguous memory region
    • here a "file" is a pair of (&str, &[u8])
  • unpack that memory region back into "files"
  • expose the "files" as a rudimentary directory tree (readonly)
  • the "unpacked" filesystem should be reasonably efficient (both memory and CPU)
  • no panicking (other than on OOM)

Non goals

  • neither packing nor unpacking are required to be especially fast
  • ensuring that filenames are "canonical" in any sense is not a goal
    • for example, the user may add a "/foo" file and a "/foo/bar" file, resulting in the root directory containing both a "foo" file and a "foo" directory