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

#2856 in Parser implementations

Download history 595/week @ 2024-07-24 499/week @ 2024-07-31 539/week @ 2024-08-07 1253/week @ 2024-08-14 916/week @ 2024-08-21 1249/week @ 2024-08-28 1296/week @ 2024-09-04 1367/week @ 2024-09-11 828/week @ 2024-09-18 843/week @ 2024-09-25 516/week @ 2024-10-02 1387/week @ 2024-10-09 1375/week @ 2024-10-16 859/week @ 2024-10-23 1143/week @ 2024-10-30 693/week @ 2024-11-06

4,235 downloads per month
Used in 3 crates (via vfs-tar)

MIT license

23KB
449 lines

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.


lib.rs:

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

Dependencies

~1MB
~19K SLoC