#tar #tarfile #encoding


A Rust implementation of an async TAR file reader and writer. This library does not currently handle compression, but it is abstract over all I/O readers and writers. Additionally, great lengths are taken to ensure that the entire contents are never required to be entirely resident in memory all at once. This fork includes the ability to disable filesystem operations, so the crate can be used in wasm32-unknown-unknown environments.

1 unstable release

0.4.2-wasm.1 Feb 25, 2023

#143 in WebAssembly

Download history 287/week @ 2023-02-24 307/week @ 2023-03-03 180/week @ 2023-03-10 298/week @ 2023-03-17 210/week @ 2023-03-24 114/week @ 2023-03-31 456/week @ 2023-04-07 203/week @ 2023-04-14 54/week @ 2023-04-21 17/week @ 2023-04-28 153/week @ 2023-05-05 28/week @ 2023-05-12 126/week @ 2023-05-19

324 downloads per month
Used in 3 crates (via nassun)




A tar archive reading/writing library for async Rust.

Based on the great tar-rs.

Reading an archive

use async_std::io::stdin;
use async_std::prelude::*;

use async_tar::Archive;

fn main() {
    async_std::task::block_on(async {
        let mut ar = Archive::new(stdin());
        let mut entries = ar.entries().unwrap();
        while let Some(file) = entries.next().await {
            let f = file.unwrap();
            println!("{}", f.path().unwrap().display());

Writing an archive

use async_std::fs::File;
use async_tar::Builder;

fn main() {
    async_std::task::block_on(async {
        let file = File::create("foo.tar").await.unwrap();
        let mut a = Builder::new(file);

        a.append_file("lib.rs", &mut File::open("src/lib.rs").await.unwrap())


Minimal stable rust version: 1.51

An increase to the MSRV is accompanied by a minor version bump


This project is licensed under either of

at your option.


Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in this project by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.


~135K SLoC