ARCHIVE_READ_OPTIONS(3)

πŸ“¦ version 15.1, in freebsd 14.5, freebsd 15.1

πŸ’– ARCHIVE_READ_OPTIONS πŸ’–

okay so bestie, welcome to the archive_read_options(3) page β€” that's the manual for the Library Functions Manual section 3, and it's literally all about the lil functions that let you control options for reading archives. libarchive girlies, this one's for you 🫢


✨ LIBRARY ✨

Streaming Archive Library (libarchive, -larchive) β€” yes queen, we're linking the real thing πŸ’…


πŸ¦‹ SYNOPSIS πŸ¦‹

int
archive_read_set_filter_option(struct archive *, const char *module,
    const char *option, const char *value);

int
archive_read_set_format_option(struct archive *, const char *module,
    const char *option, const char *value);

int
archive_read_set_option(struct archive *, const char *module,
    const char *option, const char *value);

int
archive_read_set_options(struct archive *, const char *options);

🌸 DESCRIPTION 🌸

These functions are literally the way for libarchive clients to configure specific read modules. no cap, that's the whole vibe πŸ’œ

  • archive_read_set_filter_option(), archive_read_set_format_option() β€” Specifies an option that gets passed to the currently-registered filters (decompression filters included, bestie, we love a two-for-one) or format readers.

okay so the rules of the game here:

  • If option and value are both NULL, these functions do nothing and ARCHIVE_OK comes back. chill behaviour, honestly.
  • If option is NULL but value is not, these functions do nothing and ARCHIVE_FAILED comes back. it's giving "you forgot the important part" 😭
  • If module is not NULL, option and value get handed to the filter or reader named module. The return value will be that of the module. And if there's no such module? ARCHIVE_FAILED. rip.
  • If module is NULL, option and value get handed to every registered module. If any module returns ARCHIVE_FATAL, that value gets returned immediately β€” no waiting, no negotiating πŸ’€. Otherwise, ARCHIVE_OK gets returned if any module accepts the option, and ARCHIVE_FAILED in all other cases.
  • archive_read_set_option() β€” Calls archive_read_set_format_option(), then archive_read_set_filter_option(). If either one returns ARCHIVE_FATAL, ARCHIVE_FATAL gets returned immediately. Otherwise, the greater of the two values gets returned. teamwork, but make it ranked πŸŽ€
  • archive_read_set_options() β€” options is a comma-separated list of options. If options is NULL or empty, ARCHIVE_OK gets returned immediately. periodt.

It calls archive_read_set_option() with each option in turn. If any archive_read_set_option() call returns ARCHIVE_FATAL, ARCHIVE_FATAL gets returned immediately.

Individual options have one of the following forms:

  • option=value β€” The option/value pair gets provided to every module. Modules that don't accept an option with this name will just ignore it. not their business, moving on πŸ’…
  • option β€” The option gets provided to every module with a value of β€œ1”.
  • !option β€” The option gets provided to every module with a NULL value.
  • module:option=value, module:option, module:!option β€” As above, but the corresponding option and value get provided only to modules whose name matches module.

πŸ”₯ OPTIONS πŸ”₯

ngl this section is long, but every single one of these is real and you're gonna wanna know them, so let's go bestie 🫢
  • Format cab
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
  • Format cpio
    • compat-2x β€” Libarchive 2.x incorrectly encoded Unicode filenames on some platforms. This option mimics the libarchive 2.x filename handling so that such archives can be read correctly. it's a time machine but for filename bugs πŸ•°οΈ
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
    • pwb β€” When reading a binary CPIO archive, assume that it's in the original PWB cpio format, and handle file mode bits accordingly. The default is to assume v7 format. so if you don't say anything, it's v7 energy ✨
  • Format iso9660
    • joliet β€” Support Joliet extensions. Defaults to enabled, use !joliet to disable.
    • rockridge β€” Support RockRidge extensions. Defaults to enabled, use !rockridge to disable.
  • Format lha
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
  • Format mtree
    • checkfs β€” Allow reading information missing from the mtree from the file system. Disabled by default. (so like, opt in, bestie, don't just assume πŸ‘€)
  • Format rar
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
  • Format tar
    • compat-2x β€” Libarchive 2.x incorrectly encoded Unicode filenames on some platforms. This option mimics the libarchive 2.x filename handling so that such archives can be read correctly.
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
    • mac-ext β€” Support Mac OS metadata extension that records data in special files beginning with a period and underscore. Defaults to enabled on Mac OS, disabled on other platforms. Use !mac-ext to disable.
    • read_concatenated_archives β€” Ignore zeroed blocks in the archive, which occurs when multiple tar archives have been concatenated together. Without this option, only the contents of the first concatenated archive would be read. main character energy for archive number one only, otherwise 😭
  • Format zip
    • compat-2x β€” Libarchive 2.x incorrectly encoded Unicode filenames on some platforms. This option mimics the libarchive 2.x filename handling so that such archives can be read correctly.
    • hdrcharset β€” The value is used as a character set name that will be used when translating file names.
    • ignorecrc32 β€” Skip the CRC32 check. Mostly used for testing. (so like… careful, bestie, that check is there for a reason 🚨)
    • mac-ext β€” Support Mac OS metadata extension that records data in special files beginning with a period and underscore. Defaults to enabled on Mac OS, disabled on other platforms. Use !mac-ext to disable.

😭 ERRORS 😭

Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions. when something goes wrong, these two are your group chat β€” go ask them πŸ’œ


πŸ‘‘ SEE ALSO πŸ‘‘

tar(1), archive_read(3), archive_write_set_options(3), libarchive(3)


ok that's the whole page, you ate that fr fr πŸ’…βœ¨

Debian Β· January 31, 2020 β€” that's the source and the date, mwah, slay, bye bestie πŸŽ€πŸ¦‹πŸ’–

πŸ“¦ where this page comes from