Crate larz

source ·
Expand description

§larz

A simple, fast, and efficient file archiver and compressor. larz creates archives in the GNU TAR format, and compresses them using LZ4.

§Usage

§Compression

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);

§Decompression

use larz::extract_archive_memory;
use std::path::PathBuf;

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

extract_archive_memory(paths, output_path);

§Features

  • safe - Ensures that compression and decompression are performed in a memory-safe manner. This is enabled by default.
  • streaming - larz supports streaming compression and decompression using the LZ4 frame format. This means that larz can compress and decompress files with larger sizes, without having to load the entire file into memory. This is enabled by default.

§Installation

Run cargo add larz to add larz to your Cargo.toml file. If you intend on using larz as a tool, run cargo install larz.

§License

larz is licensed under the GNU Affero General Public License.

§Contributing

Contributions are welcome! Please see CONTRIBUTING.md for more information.

§Authors

§Acknowledgements

  • lz4_flex - The LZ4 compression library used by larz.
  • tar - The TAR archiving library used by larz.

Functions§