Crate zip_extract

Source
Expand description

§Deprecated

zip-extract was born out of frustration with the zip crate’s tedious extraction methods. Things have changed: ZipArchive::extract and ZipArchive::extract_unwrapped_root_dir provide the same functionality as zip-extract, without a wrapper crate. Please use them instead.


§zip-extract

zip-extract’s primary goal is simple: Automate tedious zip extraction. Ever wanted to just unpack an archive somewhere? Well, here you go:

§Usage

See extract for details.

let archive: Vec<u8> = download_my_archive()?;
let target_dir = PathBuf::from("my_target_dir"); // Doesn't need to exist

// The third parameter allows you to strip away toplevel directories.
// If `archive` contained a single folder, that folder's contents would be extracted instead.
zip_extract::extract(Cursor::new(archive), &target_dir, true)?;

§Features

All features are passed through to zip2, refer to the documentation for defaults and a list of features.

Enums§

ZipError
Re-export of zip’s error type, for convenience. Error type for Zip
ZipExtractError
zip-extract’s error type

Functions§

extractDeprecated
Extracts a zip archive into target_dir.