ARCHIVE_READ_FILTER(3)

πŸ“¦
version 3.8.7 Β· 3 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, freebsd 14.5, freebsd 15.1, opensuse-leap 16.0, ubuntu questing, ubuntu resolute

πŸ¦‹ ARCHIVE_READ_FILTER(3) β€” functions for reading streaming archives πŸ¦‹

okay bestie, welcome to ARCHIVE_READ_FILTER(3) from the Library Functions Manual. This is the filter-support corner of libarchive, and it's honestly giving "let me sniff out the compression before we unpack anything" πŸ’….


🌸 NAME 🌸

archive_read_support_filter_all, archive_read_support_filter_bzip2, archive_read_support_filter_compress, archive_read_support_filter_gzip, archive_read_support_filter_lz4, archive_read_support_filter_lzma, archive_read_support_filter_none, archive_read_support_filter_rpm, archive_read_support_filter_uu, archive_read_support_filter_xz, archive_read_support_filter_zstd, archive_read_support_filter_program, and archive_read_support_filter_program_signature β€” these are the functions for reading streaming archives. ✨

And yes, the SYNOPSIS below has even more filter pals popping out; keep scrolling, bestie 🫢.


πŸŽ€ LIBRARY πŸŽ€

Streaming Archive Library (libarchive, -larchive). Link it and go, periodt.


✨ SYNOPSIS ✨

#include <archive.h>

int
archive_read_support_filter_all(struct archive *);

int
archive_read_support_filter_by_code(struct archive *, int);

int
archive_read_support_filter_bzip2(struct archive *);

int
archive_read_support_filter_compress(struct archive *);

int
archive_read_support_filter_grzip(struct archive *);

int
archive_read_support_filter_gzip(struct archive *);

int
archive_read_support_filter_lrzip(struct archive *);

int
archive_read_support_filter_lz4(struct archive *);

int
archive_read_support_filter_lzma(struct archive *);

int
archive_read_support_filter_lzop(struct archive *);

int
archive_read_support_filter_none(struct archive *);

int
archive_read_support_filter_rpm(struct archive *);

int
archive_read_support_filter_uu(struct archive *);

int
archive_read_support_filter_xz(struct archive *);

int
archive_read_support_filter_zstd(struct archive *);

int
archive_read_support_filter_program(struct archive *, const char *cmd);

int
archive_read_support_filter_program_signature(struct archive *,
    const char *cmd, const void *signature, size_t signature_length);

πŸ’– DESCRIPTION πŸ’–

okay so here's the tea, bestie: these functions set up filters for reading streaming archives. The vibe check is all about enabling detection and decompression support.

  • archive_read_support_filter_bzip2(), archive_read_support_filter_compress(), archive_read_support_filter_grzip(), archive_read_support_filter_gzip(), archive_read_support_filter_lrzip(), archive_read_support_filter_lz4(), archive_read_support_filter_lzma(), archive_read_support_filter_lzop(), archive_read_support_filter_none(), archive_read_support_filter_rpm(), archive_read_support_filter_uu(), archive_read_support_filter_xz(), archive_read_support_filter_zstd() β€” these enable auto-detection code and decompression support for the specified compression. They may fall back on external programs if an appropriate library was not available at build time. Decompression using an external program is usually slower than decompression through built-in libraries. And note: none is always enabled by default. πŸ’…
  • archive_read_support_filter_all() β€” enables all available decompression filters. Slay, it's literally all of them.
  • archive_read_support_filter_by_code() β€” enables a single filter specified by the filter code. This function does not work with ARCHIVE_FILTER_PROGRAM. Note: in statically-linked executables, this will cause your program to include support for every filter. If executable size is a concern, you may wish to avoid using this function. 🫢
  • archive_read_support_filter_program() β€” data is fed through the specified external program before being dearchived. Note that this disables automatic detection of the compression format, so it makes no sense to specify this in conjunction with any other decompression option. 🚨
  • archive_read_support_filter_program_signature() β€” this feeds data through the specified external program but only if the initial bytes of the data match the specified signature value. Cute and picky, iykyk.

🌈 RETURN VALUES 🌈

These functions return ARCHIVE_OK if the compression is fully supported, and ARCHIVE_WARN if the compression is supported only through an external program.

Also: archive_read_support_filter_none() always succeeds β€” no cap, it's that girl. πŸ‘‘


πŸ“ ERRORS πŸ“

Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions. Use them, bestie 😭.


🧚 SEE ALSO 🧚


πŸ’– Debian β€’ June 9, 2020 β€’ ARCHIVE_READ_FILTER(3) β€” mwah, go read some archives bestie πŸ’–

πŸ“¦ where this page comes from