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
- arch rolling: libarchive 3.8.9-1
- centos-stream 10: libarchive-devel 3.7.7-11.el10 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- debian trixie: libarchive-dev 3.7.4-4+deb13u1 Β· BSD-2-Clause
- fedora 43: libarchive-devel 3.8.1-3.fc43 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 43: libarchive-devel 3.8.1-3.fc43 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 43: libarchive-devel 3.8.4-1.fc43 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 43: libarchive-devel 3.8.4-1.fc43 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 44: libarchive-devel 3.8.4-2.fc44 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 44: libarchive-devel 3.8.4-2.fc44 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 44: libarchive-devel 3.8.7-1.fc44 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- fedora 44: libarchive-devel 3.8.7-1.fc44 Β· BSD-2-Clause AND FSFULLR AND GPL-2.0-or-later WITH Libtool-exception AND BSD-3-Clause AND FSFUL
- freebsd 14.5: base 14.5
- freebsd 15.1: base 15.1
- nixos 26.05: libarchive 3.8.9
- nixpkgs unstable: libarchive 3.8.9
- opensuse-leap 16.0: libarchive-devel 3.8.1-160000.4.1 Β· BSD-2-Clause
- opensuse-leap 16.0: libarchive-devel 3.8.1-160000.4.1 Β· BSD-2-Clause
- opensuse-leap 16.0: libarchive-devel 3.8.1-160000.4.1 Β· BSD-2-Clause
- opensuse-leap 16.0: libarchive-devel 3.8.1-160000.4.1 Β· BSD-2-Clause
- ubuntu questing: libarchive-dev 3.7.7-0ubuntu3
- ubuntu questing: libarchive-dev 3.7.7-0ubuntu3.2
- ubuntu resolute: libarchive-dev 3.8.5-1ubuntu2 Β· BSD-2-Clause
- ubuntu resolute: libarchive-dev 3.8.5-1ubuntu2.3 Β· BSD-2-Clause
- ubuntu stonking: libarchive-dev 3.8.9-1 Β· BSD-2-Clause
- 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