Skip to content

Latest commit

 

History

History
37 lines (28 loc) · 813 Bytes

README.md

File metadata and controls

37 lines (28 loc) · 813 Bytes

Streaming zip writer

fn main() {
    let mut writer = ZipWriter::new(Vec::new());

    writer.append_data("test_file", b"basically very smol file").unwrap();

    let _out = writer.finish().unwrap();
}
fn main() {
    let mut writer = ZipWriter::new(Vec::new());

    writer
        .start_file("test_file")
        .modification(std::time::SystemTime::now()) // <- time feature
        .write_all(b"basically very smol file")
        .unwrap();

    let _out = writer.finish().unwrap();
}
fn main() {
    let writer = ZipWriter::new(Cursor::new(Vec::new()));

    let mut file_writer = writer.start_file_writer("test").writer().unwrap();
    file_writer.write_all(data).unwrap();
    
    writer = file_writer.finish().unwrap();
    let _out = writer.finish().unwrap();
}