ARCHIVE_READ_HEADER(3)
π ARCHIVE_READ_HEADER π
okay bestie, welcome to archive_read_next_header(3) β the libarchive page that's literally just two functions for reading streaming archives. no cap, this is the manual for the Streaming Archive Library (that's libarchive, and you link it with -larchive π«Ά).
β¨ SYNOPSIS β¨
#include <archive.h>
int
archive_read_next_header(struct archive *, struct archive_entry **);
int
archive_read_next_header2(struct archive *, struct archive_entry *);
πΈ DESCRIPTION πΈ
so there's these two functions and they're basically sisters, okay? let me introduce you π
archive_read_next_header()β this one reads the header for the next entry and hands you back a pointer to astruct archive_entry. and the way it does that is so cute: it's a convenience wrapper aroundarchive_read_next_header2(), and it reuses one internalstruct archive_entryobject for every single request. iconic behaviour honestly. πarchive_read_next_header2()β this one reads the header for the next entry too, but instead of handing you back a pointer, it populates thestruct archive_entrythat you provided. you brought your own entry, she fills it in. main character energy β¨
π RETURN VALUES π
these functions are not shy, they will tell you exactly what happened:
ARCHIVE_OKβ slay, the operation succeeded πARCHIVE_WARNβ the operation succeeded BUT a non-critical error was encountered. so like, it worked, but she's a little messy πARCHIVE_EOFβ end-of-archive was encountered. that's it, that's the whole archive, we're done here π¦ARCHIVE_RETRYβ the operation failed but can be retried. not over yet bestie, run it back π₯ARCHIVE_FATALβ there was a fatal error and the archive should be closed immediately. no seriously. close it. right now. ππ
π ERRORS π
want the juicy details? the detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions. go ask them, they'll spill everything β¨
π SEE ALSO π
the whole friend group, fr fr:
tar(1), archive_read(3), archive_read_data(3), archive_read_extract(3), archive_read_filter(3), archive_read_format(3), archive_read_open(3), archive_read_set_options(3), archive_util(3), libarchive(3), tar(5)
and that's the page!! this one came from Debian, dated February 2, 2012 β vintage but still serving π go read some headers bestie, you got this π«Άπβ¨
π¦ where this page comes from
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- Copyright (c) 2003-2011 Tim Kientzle
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms