5 unstable releases

0.9.1 Mar 18, 2023
0.9.0 Mar 9, 2023
0.8.0 Mar 5, 2023
0.7.1 Feb 21, 2023
0.7.0 Jan 29, 2023

#22 in #tar-archive

Download history 3/week @ 2024-12-19 5/week @ 2025-02-06 3/week @ 2025-02-13 4/week @ 2025-02-20

848 downloads per month
Used in 3 crates (via vfs-tar)

MIT license

23KB
449 lines

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);
}

tar-parser

Implementation of a tar archive parser written in rust using nom.

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

For more robust example of listing TAR contents, see example ls.

Dependencies

~1MB
~18K SLoC