Skip to main content

Crate ferrosys

Crate ferrosys 

Source
Expand description

ferrosys — pure-Rust, userspace filesystem tooling.

The crate creates and reads filesystem images entirely in userspace, over ordinary byte streams, in self-contained, safe Rust. On-disk types serialize through explicit little-endian byte accessors, so the byte layout is spelled out at every field.

§Structure

The crate root holds the family-agnostic substrate — the vocabulary a detector and a scan speak, independent of which family answers them:

  • detect reads an image and reports the Filesystem family it holds, and detect_with does the same at an offset within the source, for a partition or a region a carver located; DetectError tells an unreadable source from an unrecognized one.
  • crc32c is the reflected CRC-32C primitive filesystem metadata checksums are built from. The ext module implements the ext2/ext3/ext4 family — the format writer, the Reader opened over any Read + Seek source, the TreeBuilder source, and the byte-exact on-disk structures — and is on by default. Its images are byte-reproducible: the UUID, hash seed, and timestamps are inputs, never read from the clock or a random source.

§Features

ext is on by default and is the whole filesystem surface. Three more are off by default, so a build that wants none of them depends only on thiserror:

  • tar adds the tar/PAX archive source and sink: a filesystem built from an archive, and one written back out as one. It depends on tar.
  • dir adds the host-directory source: a filesystem built by walking a tree on this machine, with its modes, ownership, times, hard links, special files, and extended attributes. It depends on rustix for the two extended-attribute calls the standard library has no equivalent of, and is present on Linux.
  • serde adds Serialize to the scan taxonomy, the planned geometry, and the feature model, for embedding them in a document of your own. It depends on serde.

Modules§

ext
The ext2/ext3/ext4 family: the formatter, the reader, and the byte-exact on-disk structures.

Structs§

DetectOptions
Where to look for a filesystem, and anything else detection needs to be told.

Enums§

DetectError
A failure detecting the filesystem in an image.
Filesystem
The filesystem family an image holds, as detect classifies it.

Functions§

crc32c
crc32c of data, continued from seed.
detect
Detect the filesystem family at the start of an image.
detect_with
Detect the filesystem family an image holds under options.