# Libarchive

> Mediated Wiki article. Canonical URL: https://mediated.wiki/source/Libarchive
> Markdown URL: https://mediated.wiki/source/Libarchive.md
> Source: https://en.wikipedia.org/wiki/Libarchive
> Source revision: 1329370727
> License: Creative Commons Attribution-ShareAlike 4.0 International (https://creativecommons.org/licenses/by-sa/4.0/)

{{Sources exist|date=June 2023}}
{{Short description|Open-source archive and compression library}}
{{use dmy dates|date=May 2023}}
{{lowercase title}}
{{infobox software
| title = libarchive
| logo = 
| screenshot = 
| author = 
| developer = 
| released = {{start date and age|2003}}{{r|name="ReleaseNotes"}}
| latest release version = {{wikidata|property|preferred|references|edit|Q64374525|P348|P548=Q2804309}}
| latest release date = {{wikidata|qualifier|preferred|single|Q64374525|P348|P548=Q2804309|P577}}
| latest preview version = {{wikidata|property|preferred|references|edit|Q64374525|P348|P548=Q51930650}}
| latest preview date = {{wikidata|qualifier|preferred|single|Q64374525|P348|P548=Q51930650|P577}}
| programming language = [C](/source/C_(programming_language))
| operating system = [cross-platform](/source/cross-platform_software)
| genre = [library](/source/library_(computing))
| license = [New BSD License](/source/BSD_licenses){{r|name="www.libarchive.org"}}
}}
'''libarchive''' is a [free and open-source](/source/free_and_open-source_software) [library](/source/library_(computing)) for reading and writing various [archive](/source/archive_file) and [compression formats](/source/list_of_archive_formats). It is written in [C](/source/C_(programming_language)) and works on most [Unix-like](/source/Unix-like) systems and [Windows](/source/Microsoft_Windows).<ref name="www.libarchive.org">{{cite web |title=libarchive |url=https://www.libarchive.org/ |url-status=live |archive-url=https://web.archive.org/web/20230524004252/https://www.libarchive.org/ |archive-date=2023-05-24 |access-date=2023-05-25 |website=www.libarchive.org |language=en}}</ref>

==History==
libarchive's development was started in 2003 as part of the [FreeBSD](/source/FreeBSD) project.<ref name="ReleaseNotes">{{cite web |url=https://github.com/libarchive/libarchive/wiki/ReleaseNotes |title=ReleaseNotes |access-date=2023-05-25 |website=GitHub |archive-url=https://web.archive.org/web/20220312005639/https://github.com/libarchive/libarchive/wiki/ReleaseNotes |archive-date=2022-03-12 |url-status=live |language=en}}</ref> During the early years it was led by the FreeBSD project, but later it became an independent project.<ref name="ReleaseEngineering">{{cite web |url=https://github.com/libarchive/libarchive/wiki/ReleaseEngineering |title=ReleaseEngineering |access-date=2023-05-25 |website=GitHub |archive-url=https://web.archive.org/web/20220430100141/https://github.com/libarchive/libarchive/wiki/ReleaseEngineering |archive-date=2022-04-30 |url-status=live |language=en}}</ref> It was first released with FreeBSD 5.3 in November 2004.<ref name="LibarchiveUsers">{{cite web |url=https://github.com/libarchive/libarchive/wiki/LibarchiveUsers |title=LibarchiveUsers |access-date=2023-05-25 |website=GitHub |archive-url=https://web.archive.org/web/20221128123136/https://github.com/libarchive/libarchive/wiki/LibarchiveUsers |archive-date=2022-11-28 |url-status=live |language=en}}</ref>

==libarchive==
libarchive automatically detects and reads archive formats.<ref name="libarchive-man">{{man|3|libarchive|FreeBSD}}</ref> If the archive is compressed, libarchive also detects and handles compression formats before evaluating the archive.{{r|name="libarchive-man"}} libarchive is designed to minimize the copying of data internally for optimal performance.<ref name="ZeroCopy">{{cite web |url=https://github.com/libarchive/libarchive/wiki/ZeroCopy |title=ZeroCopy |access-date=2023-05-25 |website=GitHub |archive-url=https://web.archive.org/web/20220430121404/https://github.com/libarchive/libarchive/wiki/ZeroCopy |archive-date=2022-04-30 |url-status=live |language=en}}</ref>

Supported archive formats:<ref>{{cite web |title=Libarchive Formats |url=https://github.com/libarchive/libarchive/wiki/LibarchiveFormats |website=GitHub |archive-url=https://web.archive.org/web/20200911161029/https://github.com/libarchive/libarchive/wiki/LibarchiveFormats |archive-date=September 11, 2020 |date=January 17, 2020 |url-status=live}}</ref>
* [7z](/source/7z) – read and write
* [ar](/source/ar_(Unix)) – read and write
* [cab](/source/Cabinet_(file_format)) – read only
* [cpio](/source/cpio) – read and write
* [ISO9660](/source/ISO9660) – read and write
* [lha](/source/LHA_(file_format)) & [lzh](/source/LHA_(file_format)) – read only
* [pax](/source/pax_(command)) – read and write
* [rar](/source/RAR_(file_format)) – read only
* [shar](/source/Shar_(file_format)) – write only
* [tar](/source/tar_(computing)) – read and write
* [warc](/source/WARC_(file_format)) (ISO 28500:2009) – read and write
* [xar](/source/xar_(archiver)) – read and write
* [zip](/source/ZIP_(file_format)) – read and write

==Utilities==
libarchive provides [command-line](/source/command-line_interface) utilities called <code>bsdtar</code> and <code>bsdcpio</code>.{{r|name="www.libarchive.org"}} These are complete re-implementation based on libarchive.<ref name="bsdtar-man">{{man|1|bsdtar|FreeBSD}}</ref><ref name="bsdcpio-man">{{man|1|bsdcpio|FreeBSD}}</ref> These are the default system [tar](/source/tar_(computing)) and [cpio](/source/cpio) on [FreeBSD](/source/FreeBSD), [NetBSD](/source/NetBSD), [macOS](/source/macOS) and Windows.{{r|name="LibarchiveUsers"}}

There is also <code>bsdcat</code>, designed to decompress a file to the standard output like [zcat](/source/zcat).<ref>{{man|1|bsdcat|FreeBSD}}</ref>

==Users==
libarchive was originally developed for FreeBSD, but is also used in NetBSD and macOS as part of those operating systems.{{r|name="LibarchiveUsers"}}

<code>bsdtar</code> has been included in Windows since [Windows 10 April 2018 Update](/source/Windows_10%2C_version_1803).<ref name="tar-and-curl-come-to-windows">{{cite web |date=2019-03-21 |title=Tar and Curl Come to Windows! |url=https://techcommunity.microsoft.com/t5/containers/tar-and-curl-come-to-windows/ba-p/382409 |url-status=live |archive-url=https://web.archive.org/web/20230415164646/https://techcommunity.microsoft.com/t5/containers/tar-and-curl-come-to-windows/ba-p/382409 |archive-date=2023-04-15 |access-date=2023-05-25 |website=Microsoft Community Hub |language=en}}</ref> In May 2023, [Microsoft](/source/Microsoft) announced [Windows 11](/source/Windows_11) will natively support additional archive formats such as [7z](/source/7z) and [RAR](/source/RAR_(file_format)) via libarchive.<ref name="bringing-the-power-of-ai-to-windows-11-unlocking-a-new-era-of-productivity-for-customers-and-developers-with-windows-copilot-and-dev-home">{{cite web |last=Panay |first=Panos |author-link=Panos Panay (Microsoft) |date=2023-05-23 |title=Bringing the power of AI to Windows 11 - unlocking a new era of productivity for customers and developers with Windows Copilot and Dev Home |url=https://blogs.windows.com/windowsdeveloper/2023/05/23/bringing-the-power-of-ai-to-windows-11-unlocking-a-new-era-of-productivity-for-customers-and-developers-with-windows-copilot-and-dev-home/ |url-status=live |archive-url=https://web.archive.org/web/20230525120145/https://blogs.windows.com/windowsdeveloper/2023/05/23/bringing-the-power-of-ai-to-windows-11-unlocking-a-new-era-of-productivity-for-customers-and-developers-with-windows-copilot-and-dev-home/ |archive-date=2023-05-25 |access-date=2023-05-25 |website=Windows Developer Blog |language=en}}</ref>

==References==
{{reflist}}

==External links==
*{{official website}}

Category:2003 software
Category:C (programming language) libraries
Category:Free software programmed in C
Category:Cross-platform software
Category:File archivers
Category:Free data compression software
Category:Software using the BSD license

{{compu-library-stub}}

---
Adapted from the Wikipedia article [Libarchive](https://en.wikipedia.org/wiki/Libarchive) by Wikipedia contributors ([contributor history](https://en.wikipedia.org/wiki/Libarchive?action=history)). Available under [Creative Commons Attribution-ShareAlike 4.0 International](https://creativecommons.org/licenses/by-sa/4.0/). Changes may have been made.
