#zip #zip-file

unzpack

A library to persist ZIP content bytes into a file and extract its content on file system

1 unstable release

0.1.0 May 17, 2020

#38 in #zip-file

MIT/Apache

8KB
98 lines

Unzpack Build Status Crates.io version Released API docs

A library to persist ZIP content bytes into a file and extract its content on file system.

Unzpack is just a helper which persists ZIP bytes content on file system, then extract its content into a specific directory path and finally deletes current ZIP file.

For example, it can be useful when ZIP content is provided via include_bytes! macro.

Usage

[dependencies]
unzpack = "0.1"
use unzpack::Unzpack;

const BYTES: &[u8] = include_bytes!("data/assets.zip");

fn main() -> Result<(), Box<dyn std::error::Error>> {
    Unzpack::unpack(
        BYTES,              // Zip bytes
        "./out-file.zip",   // Output Zip file 
        "./out-dir",        // Output extraction directory 
    )?;

    Ok(())
}

View code example.

Contributions

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in current work by you, as defined in the Apache-2.0 license, shall be dual licensed as described below, without any additional terms or conditions.

Feel free to send some Pull request or issue.

License

This work is primarily distributed under the terms of both the MIT license and the Apache License (Version 2.0).

© 2020 Jose Quintana

Dependencies

~2.1–3.5MB
~58K SLoC