12 releases (6 breaking)
0.7.2 | Feb 2, 2023 |
---|---|
0.7.0 | Jan 27, 2023 |
0.5.0 | Dec 16, 2022 |
0.3.0 | Nov 30, 2022 |
#156 in Compression
102 downloads per month
Used in rfmp
14KB
269 lines
mtzip
MTZIP (Stand for Multi-Threaded ZIP) is a library for making zip archives utilising all the threads of the machine.
Example usage:
use mtzip::ZipArchive;
// Creating the zipper that holds data and handles compression
let zipper = ZipArchive::default();
// Adding a file from filesystem
zipper.add_file("input/test_text_file.txt", "test_text_file.txt");
// Adding a file from a byte array
zipper.add_file_from_slice(b"Hello, world!", "hello_world.txt");
// Adding a directory and a file to it
zipper.add_directory("test_dir");
// And adding a file to it
zipper.add_file("input/file_that_goes_to_a_dir.txt", "test_dir/file_that_goes_to_a_dir.txt");
// Writing to a file
// First, open the file
let mut file = File::create("output.zip").unwrap();
// Then, write to it
zipper.write(&mut file); // Amount of threads is chosen automatically
Dependencies
~300KB