---
name: "archive_read_free"
section: "3"
platform: "macos"
package: "libarchive"
version: "167.120.3"
release: "macOS 26.5"
platforms: ["linux", "freebsd", "macos"]
url: "https://new.carta.tech/archive_read_free"
---

# archive\_read\_free(3)

functions for reading streaming archives

## NAME

**archive\_read\_close**, **archive\_read\_finish**, **archive\_read\_free** - functions for reading streaming archives

## LIBRARY

Streaming Archive Library (libarchive, -larchive)

## SYNOPSIS

**#include \<archive.h\>**\
 *int*\
 **archive\_read\_close**(*struct archive \**);\
 *int*\
 **archive\_read\_finish**(*struct archive \**);\
 *int*\
 **archive\_read\_free**(*struct archive \**);

## DESCRIPTION

- **archive\_read\_close**()

  Complete the archive and invoke the close callback.

- **archive\_read\_finish**()

  This is a deprecated synonym for **archive\_read\_free**(). The new name was introduced with libarchive 3.0. Applications that need to compile with either libarchive 2 or libarchive 3 should continue to use the **archive\_read\_finish**() name. Both names will be supported until libarchive 4.0 is released, which is not expected to occur earlier than 2013.

- **archive\_read\_free**()

  Invokes **archive\_read\_close**() if it was not invoked manually, then release all resources. Note: In libarchive 1.x, this function was declared to return *void ,* which made it impossible to detect certain errors when **archive\_read\_close**() was invoked implicitly from this function. The declaration is corrected beginning with libarchive 2.0.

## RETURN VALUES

These functions return **ARCHIVE\_OK** on success, or **ARCHIVE\_FATAL**.

## ERRORS

Detailed error codes and textual descriptions are available from the **archive\_errno**() and **archive\_error\_string**() functions.

## SEE ALSO

[**archive\_read\_data**(3)](/archive_read_data/3.md), [**archive\_read\_filter**(3)](/archive_read_filter/3.md), [**archive\_read\_format**(3)](/archive_read_format/3.md), [**archive\_read\_new**(3)](/archive_read_new/3.md), [**archive\_read\_open**(3)](/archive_read_open/3.md), [**archive\_read\_set\_options**(3)](/archive_read_set_options/3.md), [**archive\_util**(3)](/archive_util/3.md), [**libarchive**(3)](/libarchive/3.md)
