tar
Streaming Rust library for reading and writing TAR archives
Repository Health
Technical Analysis
tar is a Rust library for reading and writing TAR archives, built to work over any I/O reader or writer without requiring the whole archive to be resident in memory at once. It does not handle compression itself, leaving callers free to layer gzip, zstd, or other codecs on top via the standard Read/Write traits.
The crate exposes an Archive type for iterating over entries in an existing tar file and a Builder type for constructing new archives entry by entry, along with lower-level Header/Entry types for inspecting or crafting archive metadata such as permissions, ownership, and PAX extended attributes.
What You Get
- An
Archivereader that streams entries one at a time instead of loading the whole file into memory - A
Builderwriter for constructing new TAR archives from files, directories, or in-memory data - Full
Headerand PAX extended-header support for permissions, ownership, and long filenames - Generic over any
Read/Writeimplementation, so compression codecs can be layered on top freely - Cross-platform path and permission handling for both Unix and Windows archive entries
Common Use Cases
- Unpacking
.tar.gzor.tar.zstrelease archives after piping through a decompression reader - Building deployment or backup archives programmatically from a set of files and directories
- Streaming very large archives without buffering their entire contents in memory
- Implementing package-manager or container-image tooling that needs to read/write layer archives
- Inspecting archive metadata (permissions, ownership, PAX attributes) for security or compliance tooling
Under The Hood
Architecture - The crate is organized around src/archive.rs (streaming reader over entries), src/builder.rs (archive construction), src/entry.rs/src/entry_type.rs (per-entry data and type classification), and src/header.rs (the ~512-byte TAR header format plus GNU/PAX extensions in src/pax.rs). Because it works generically over Read/Write, callers compose it with any I/O source — files, network streams, or in-memory buffers — and any compression layer.
Tech Stack - A dependency-light Rust crate (edition 2021, MSRV 1.63) with a single production dependency, filetime, for cross-platform file-time metadata. Dev-dependencies include tokio/tokio-stream and astral-tokio-tar for testing interoperability with async tar implementations, plus rand and tempfile for fuzz-adjacent and filesystem-based tests. A fuzz/ directory holds cargo-fuzz targets for hardening the header/PAX parsing paths against malformed input.
Code Quality - src/header.rs alone is nearly 1,800 lines, reflecting the accumulated edge cases of the TAR format (GNU long-name extensions, PAX records, sparse files); tests/all.rs and tests/entry.rs exercise reading/writing behavior against a corpus of real-world archives under tests/archives/. The presence of a dedicated fuzz/ target and a REVIEW.md file suggests an unusually deliberate security-review process for a format-parsing library that regularly consumes untrusted input.
API Design - The two-type split (Archive for reading, Builder for writing) keeps the API easy to reason about, and both accept generic I/O types so users aren’t forced into a particular file or compression abstraction. Getting started requires only a couple of lines — open a File, wrap it in Archive::new, and iterate .entries() — with more advanced options (permissions, PAX headers) available but not required for basic use.
Used by 18 apps in this directory
Meilisearch
Search
Lightning-fast hybrid search engine with AI-powered semantic and full-text retrieval for modern applications.
melty
AI Code Assistants · Code Editors · Developer Tools
The AI code editor where every chat message is a git commit you can revert, branch, or squash
mesh-llm
AI Agents · AI Development
Mesh LLM pools GPUs and memory across every machine you own into one OpenAI-compatible API, so agents tap distributed compute instead of a single GPU box or a metered cloud bill.
Mistle
AI Agents · Developer Tools
Self-hostable platform for running autonomous coding agents in isolated, credentialless sandboxes with brokered credentials, reusable snapshots, and event-driven triggers.
OpenShell
AI Agents · Developer Tools
The safe, private runtime that lets autonomous AI agents operate in sandboxed environments governed by declarative YAML policies — blocking data exfiltration, credential leaks, and unauthorized network activity before they happen.
Spacedrive
Collaboration · File Storage
One file manager for all your devices and clouds — powered by a Virtual Distributed File System built in Rust.
Temps
Analytics · Devops · Monitoring
A self-hosted Rust PaaS that replaces Vercel, Sentry, PostHog, Pingdom, Resend, and E2B with one binary — plus 440+ CLI operations agents like Claude Code can drive directly.
Vibe Kanban
AI Agents · AI Code Assistants · Project Management
A kanban board for planning work and dispatching Claude Code, Codex, Gemini CLI, and eight other coding agents into isolated git worktrees, then reviewing and merging their diffs from one UI.
Void
AI Code Assistants · Automation · Code Editors
Open-source AI code editor with direct LLM integration and data privacy