Crate tar_parser2

Source
Expand description

A nom-based parser for TAR files. This parser only accepts byte slice and doesn’t deal with IO.

let file = std::fs::read("foo.tar")?;
let (_, entries) = tar_parser2::parse_tar(&file[..])?;
for entry in entries {
    println!("{}", entry.header.name);
}

Structs§

GnuExtraHeader
GNU ustar extra header.
PosixExtraHeader
POSIX ustar extra header. See parse_tar for usage.
Sparse
Sparse index block.
TarEntry
A tar entry. Maybe a file, a directory, or some extensions.
TarEntryStreaming
A tar entry extracted using parse_entry_streaming. Maybe a file, a directory, or some extensions.
TarHeader
A tar header.
UStarHeader
Ustar header.

Enums§

ExtraHeader
Extra TAR header.
TypeFlag
Type of entry.
UStarExtraHeader
Extra header of ustar header.

Functions§

parse_entry_streaming
Tries to parse the data and extract a tar entry.
parse_long_name
Parse GNU long pathname or linkname.
parse_pax
Parse PAX properties.
parse_tar
Parse the whole data as a TAR file, and return all entries.