flatfs

Crates.ioflatfs
lib.rsflatfs
version0.2.1
sourcesrc
created_at2023-10-06 19:57:41.347846
updated_at2024-01-04 05:07:29.947369
descriptionA readonly filesystem.
homepage
repositoryhttps://github.com/moturus/flatfs
max_upload_size
id995343
size21,669
(lasiotus)

documentation

README

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
Commit count: 0

cargo fmt