#zip-archive #zip #unzip #archive

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

#14 in #unzip

Download history 40/week @ 2023-12-31 25/week @ 2024-01-07 146/week @ 2024-01-14 30/week @ 2024-01-28 41/week @ 2024-02-04 15/week @ 2024-02-11 44/week @ 2024-02-18 29/week @ 2024-02-25 35/week @ 2024-03-03 29/week @ 2024-03-10 23/week @ 2024-03-17 32/week @ 2024-03-24 20/week @ 2024-03-31

107 downloads per month

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

~1.7–2.8MB
~46K SLoC