Zip archive
zip_archive is a library that select 7z executable that are depending on the operating system,
and run it with multithread.
Requirements
Windows 10
- Install 7-Zip.
- Find 7z.exe file in installed 7z folder and add it to path. Or place 7z.exe in project root folder.
macOS
- Download 7-Zip console version executable for macOS.
- Place 7zz executable to home directory.
Examples
- Compress root directory with multithread.
use PathBuf;
use Archiver;
let origin = from;
let dest = from;
let thread_count = 4;
let mut archiver = new;
archiver.push;
archiver.set_destination;
archiver.set_thread_count;
match archiver.archive;
- Compress each directory using the container's iterator.
use PathBuf;
use Archiver;
let origin = from;
let dest = from;
let mut archiver = new;
archiver.push_from_iter;
archiver.set_destination;
match archiver.archive;
- Compress subdirectories with a depth of 1.
use PathBuf;
use ;
let origin = from; // Change to the wanted directory.
let dest = from;
let mut archiver = new;
archiver.push_from_iter;
archiver.set_destination;
match archiver.archive;