Libarchive

{{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

| operating system = cross-platform

| genre = library

| license = New BSD License{{r|name="www.libarchive.org"}}

}}

libarchive is a free and open-source library for reading and writing various archive and compression formats. It is written in C and works on most Unix-like systems and Windows.{{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}}

History

libarchive's development was started in 2003 as part of the FreeBSD project.{{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}} During the early years it was led by the FreeBSD project, but later it became an independent project.{{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}} It was first released with FreeBSD 5.3 in November 2004.{{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}}

libarchive

libarchive automatically detects and reads archive formats.{{man|3|libarchive|FreeBSD}} 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.{{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}}

Supported archive formats:{{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}}

  • 7z – read and write
  • ar – read and write
  • cab – read only
  • cpio – read and write
  • ISO9660 – read and write
  • lha & lzh – read only
  • pax – read and write
  • rar – read only
  • shar – write only
  • tar – read and write
  • warc (ISO 28500:2009) – read and write
  • xar – read and write
  • zip – read and write

Utilities

libarchive provides command-line utilities called bsdtar and bsdcpio.{{r|name="www.libarchive.org"}} These are complete re-implementation based on libarchive.{{man|1|bsdtar|FreeBSD}}{{man|1|bsdcpio|FreeBSD}} These are the default system tar and cpio on FreeBSD, NetBSD, macOS and Windows.{{r|name="LibarchiveUsers"}}

There is also bsdcat, designed to decompress a file to the standard output like zcat.{{man|1|bsdcat|FreeBSD}}

Users

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

bsdtar has been included in Windows since Windows 10 April 2018 Update.{{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}} In May 2023, Microsoft announced Windows 11 will natively support additional archive formats such as 7z and RAR via libarchive.{{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}}

References

{{reflist}}