A portable C library for reading and writing streaming archives in multiple formats, with command-line tools.
Libarchive is a portable C library that provides a unified interface for reading and writing streaming archives in numerous formats, including tar, cpio, ZIP, and 7-Zip. It solves the problem of handling diverse archive and compression types programmatically, with automatic format detection and support for on-the-fly processing. The project also includes command-line tools like bsdtar and bsdcpio that leverage the library for robust archiving operations.
System developers, software engineers, and tool creators who need to integrate archive reading/writing capabilities into applications, especially those dealing with large or streaming data sources.
Developers choose libarchive for its extensive format support, stream-oriented efficiency, and portable C implementation, which allows seamless integration into various environments without bloating binary sizes. Its consistent API simplifies handling multiple archive types, and the included command-line tools offer reliable replacements for traditional utilities.
Multi-format archive and compression library
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Automatically detects and handles over 30 archive formats and compression methods, from common tar and ZIP to proprietary RAR and 7-Zip, as detailed in the README's supported formats list.
Optimized for single-pass reading and writing, enabling processing of archives too large for disk or from streaming sources like network or tape drives, per the library design notes.
Written in C with minimal static link pollution to keep binary sizes small, ensuring broad compatibility across platforms and embedded systems, as emphasized in the README.
Includes bsdtar, bsdcpio, and bsdcat as robust, full-featured replacements for traditional archiving utilities, built directly on the library and documented with manual pages.
The library is strictly stream-oriented and does not support in-place modification or efficient random access to archive entries, requiring full re-scans for updates, as admitted in the README's design notes.
Functions like archive_write_disk_header() are not thread-safe and can cause security issues, and the library requires manual locking for multi-threaded use, with platform-dependent limitations noted in the README.
Support for formats like RAR is limited due to their proprietary nature, which may not meet the needs of applications requiring full compliance or advanced features, as mentioned in the supported formats list.