Function larz::compress_archive_memory

source ·
pub fn compress_archive_memory<W: Write>(
    paths: Vec<PathBuf>,
    output_path: PathBuf,
    optional_logger: Option<&mut BufWriter<W>>
)
Expand description

Archive & compress a file or set of files, in memory

§Arguments

  • paths - A list of paths pointing to files or directories intended to be archived

  • output_path - Path to write the archive to

  • optional_logger - An optional BufWriter to log information to

§Panics

This function will panic if any of the input paths are invalid or cannot be read, if the output path is invalid, or if the archive cannot be written to.

§Examples

use larz::compress_archive_memory;
use std::path::PathBuf;
use std::io::StdoutLock;

let paths = vec![PathBuf::from("path/to/file"), PathBuf::from("path/to/directory")];
let output_path = PathBuf::from("path/to/output.larz");

compress_archive_memory::<StdoutLock>(paths, output_path, None);