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

#1666 in Parser implementations

Download history 972/week @ 2024-02-26 1918/week @ 2024-03-04 1779/week @ 2024-03-11 932/week @ 2024-03-18 1202/week @ 2024-03-25 2555/week @ 2024-04-01 2589/week @ 2024-04-08 112/week @ 2024-04-15 3408/week @ 2024-04-22 2871/week @ 2024-04-29 2375/week @ 2024-05-06 1951/week @ 2024-05-13 2320/week @ 2024-05-20 2173/week @ 2024-05-27 1403/week @ 2024-06-03 822/week @ 2024-06-10

6,786 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
~20K SLoC