History of Idiom 217 > diff from v5 to v6
Edit summary for version 6 by swedebugia:
New Rust implementation by user [swedebugia]
New Rust implementation by user [swedebugia]
↷
Version 5
2020-04-16, 16:35:52
Version 6
2020-04-16, 16:37:55
Idiom #217 Create a Zip archive
Create a zip-file with filename name and add the files listed in list to that zip-file.
Idiom #217 Create a Zip archive
Create a zip-file with filename name and add the files listed in list to that zip-file.
Extra Keywords
zipExtra Keywords
zipCode
fn zip(_name: &str, _list: Vec<&str>) -> zip::result::ZipResult<()>
{
let path = std::path::Path::new(_name);
let file = std::fs::File::create(&path).unwrap();
let mut zip = zip::ZipWriter::new(file);
for i in _list.iter() {
zip.start_file(i as &str, FileOptions::default())?;
}
zip.finish()?;
Ok(())
}
Comments bubble