Skip to main content

compress_file_into

Function compress_file_into 

Source
pub fn compress_file_into<P, W>(
    path: P,
    destination: W,
    level: i32,
) -> Result<()>
where P: AsRef<Path>, W: Write,
Expand description

Compress the contents of a file into destination.

Like compress_file(), but writing rather than handing back a Vec - so nothing beyond the compressor’s own buffers is held, whatever the size of the file.

let output = std::fs::File::create("input.txt.zst")?;

zstd::compress_file_into("input.txt", output, 3)?;