archive_read_header(3)

archive_read_header3

Functions for reading streaming archives

Usage

#include <archive.h>

int

archive_read_next_header(struct archive *, struct archive_entry **);

int

archive_read_next_header2(struct archive *, struct archive_entry *);

Library

Streaming Archive Library (libarchive, -larchive)

Overview

archive_read_next_header()

Read the header for the next entry and return a pointer to a struct archive_entry. This is a convenience wrapper around archive_read_next_header2() that reuses an internal struct archive_entry object for each request.

archive_read_next_header2()

Read the header for the next entry and populate the provided struct archive_entry.

Return values

These functions return ARCHIVE_OK (the operation succeeded), ARCHIVE_WARN (the operation succeeded but a non-critical error was encountered), ARCHIVE_EOF (end-of-archive was encountered), ARCHIVE_RETRY (the operation failed but can be retried), and ARCHIVE_FATAL (there was a fatal error; the archive should be closed immediately).

Errors

Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions.

Releases

30 releases since FreeBSD 10.0-RELEASE; the text changed 6 times.

  1. 10.0–11.3
  2. 11.4
  3. 12.0–12.1
  4. 12.2–13.3
  5. 13.4–13.5
  6. 14.0
  7. 14.1–16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.