Module read

Source
Expand description

Facilities for reading SquashFS archives.

The most common scenario for using this library is:

  1. To open a SquashFS file, use [Archive::new].
  2. Call get to retrieve a Node by its path.
  3. Call data to get a Data object containing the node’s data.

Node also provides methods for inspecting metadata, resolving symlinks, and conveniently converting to file and directory objects.

let archive = Archive::open("archive.sfs")?;
match archive.get("/etc/passwd")? {
    None => println!("File not present"),
    Some(node) => if let Data::File(file) = node.data()? {
        println!("{}", file.to_string()?);
    },
}

Structs§

Archive
An open SquashFS archive.
Dir
A directory in the archive.
File
A file in the archive.
Node
Information about a single node in the directory tree.
OwnedDir
An object packaging a Dir with the Node from which it was constructed.
OwnedFile
An object packaging a File with the Node from which it was constructed.

Enums§

Data
Enum type for the various kinds of data that an inode can be.
XattrType
Represents the namespace of extended attributes.