#bindings #libarchive #high #level #reader #akv

libarchive_src

Source and raw bindings of libarchive. High level bindings are available in crate akv.

1 unstable release

0.1.0 Jan 7, 2023

#6 in #libarchive

24 downloads per month
Used in akv

MIT/Apache

6.5MB
157K SLoC

C 152K SLoC // 0.2% comments Automake 1.5K SLoC // 0.0% comments M4 1.5K SLoC // 0.3% comments Shell 1K SLoC // 0.2% comments AWK 770 SLoC // 0.1% comments RPM Specfile 293 SLoC // 0.0% comments Batch 263 SLoC // 0.0% comments Rust 123 SLoC C++ 41 SLoC

Contains (obscure autoconf code, 42KB) libarchive/configure.ac

akv

Safe bindings for libarchive with minimum overhead

Example

use akv::reader::ArchiveReader;

let io_reader = std::fs::File::open("tests/simple.zip")?;
let mut archive_reader = ArchiveReader::open_io(io_reader)?;

while let Some(entry) = archive_reader.next_entry()? {
    println!("Entry name: {}", entry.pathname_utf8()?);
    let entry_reader = entry.into_reader();
    println!(
        "Entry content: {}",
        std::io::read_to_string(entry_reader)?
    );
}
std::io::Result::Ok(())

Dependencies

~12MB
~204K SLoC