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
4,235 downloads per month
Used in 3 crates
(via vfs-tar)
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