tar-codec
An asynchronous tar reader and writer for Rust. Reads POSIX pax/ustar and GNU archives and writes pax archives. The reader rejects UNIX v7 archives and streams that mix GNU and pax headers.
This crate is a component of astral-codec.
[!IMPORTANT]
This crate is in early development and is not ready for production use.
Writing
use ;
let payload = from_path.await?;
let mut encoder = new.builder;
encoder
.add_file
.await?;
encoder.finish.await?;
Use add_directory for a directory entry or add_directory_all to include its
contents. Set Builder::with_policy before adding members to configure name
validation and handling of symlinks.
For compressed output such as .tar.gz, wrap the writer in a compressor from
async-compression.
Extraction
use ;
new
.extract_in
.await?;
Use TarArchive::with_policy to configure GNU and pax decoding. ExtractPolicy
controls how members are written to disk.
Performance
See BENCHMARKS for comparisons with tar and
astral-tokio-tar.