ARCHIVE_READ_FREE(3)
π ARCHIVE_READ_FREE(3) π
okay bestie, so this is a page from the Library Functions Manual, and the whole vibe is: how to properly say bye-bye to a streaming archive you've been reading πβ¨
π 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 *);
three little functions, one big cleanup era π
πΈ DESCRIPTION πΈ
archive_read_close()β wraps up the archive and calls the close callback. it's giving graceful exit β¨archive_read_finish()β bestie this one is a deprecated synonym forarchive_read_free(). the new name showed up with libarchive 3.0. so if your app needs to compile against either libarchive 2 or libarchive 3, you should keep using thearchive_read_finish()name. both names are supported until libarchive 4.0 drops β and that's not expected to happen any earlier than 2013. so like. we're fine πarchive_read_free()β if you didn't already callarchive_read_close()yourself, this one calls it for you, and then releases all the resources. π
π¨ note, and this one's important: in libarchive 1.x this function was declared to returnvoid, which made it literally impossible to detect certain errors whenarchive_read_close()got invoked implicitly from inside this function. the declaration was corrected starting with libarchive 2.0. glow-up fr fr π¦
π RETURN VALUES π
These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL. that's it. no in-between, no situationship π
π ERRORS π
want the deets? detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions. iykyk π₯
π SEE ALSO π
archive_read_data(3)archive_read_filter(3)archive_read_format(3)archive_read_new(3)archive_read_open(3)archive_read_set_options(3)archive_util(3)libarchive(3)
Debian β February 2, 2012 π
and that's the whole page bestie, mwah, go free your archives responsibly ππ«Άβ¨
π¦ 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