ARCHIVE_WRITE_FORMAT(3)
π ARCHIVE_WRITE_FORMAT(3) π
okay bestie, this is from the Library Functions Manual and it's giving archive-format royalty. The whole page is about functions for creating archives β no cap, we're setting formats today.
πΈ NAME πΈ
The full squad, fr fr β functions for creating archives:
archive_write_set_formatarchive_write_set_format_7ziparchive_write_set_format_ararchive_write_set_format_ar_bsdarchive_write_set_format_ar_svr4archive_write_set_format_by_namearchive_write_set_format_cpioarchive_write_set_format_cpio_binarchive_write_set_format_cpio_newcarchive_write_set_format_cpio_odcarchive_write_set_format_cpio_pwbarchive_write_set_format_filter_by_extarchive_write_set_format_filter_by_ext_defarchive_write_set_format_gnutararchive_write_set_format_iso9660archive_write_set_format_mtreearchive_write_set_format_mtree_classicarchive_write_set_format_mtree_defaultarchive_write_set_format_paxarchive_write_set_format_pax_restrictedarchive_write_set_format_rawarchive_write_set_format_shararchive_write_set_format_shar_dumparchive_write_set_format_ustararchive_write_set_format_v7tararchive_write_set_format_warcarchive_write_set_format_xararchive_write_set_format_zip
π LIBRARY π
Streaming Archive Library (libarchive, -larchive) β that's the exact link line, bestie.
β¨ SYNOPSIS β¨
Copy-paste this exactly, okay? Character-for-character realness.
#include <archive.h>
int
archive_write_set_format(struct archive *, int code);
int
archive_write_set_format_7zip(struct archive *);
int
archive_write_set_format_ar(struct archive *);
int
archive_write_set_format_ar_bsd(struct archive *);
int
archive_write_set_format_ar_svr4(struct archive *);
int
archive_write_set_format_by_name(struct archive *, const char *name);
int
archive_write_set_format_cpio(struct archive *);
int
archive_write_set_format_cpio_bin(struct archive *);
int
archive_write_set_format_cpio_newc(struct archive *);
int
archive_write_set_format_cpio_odc(struct archive *);
int
archive_write_set_format_cpio_pwb(struct archive *);
int
archive_write_set_format_filter_by_ext(struct archive *,
const char *filename);
int
archive_write_set_format_filter_by_ext_def(struct archive *,
const char *filename, const char *def_ext);
int
archive_write_set_format_gnutar(struct archive *);
int
archive_write_set_format_iso9660(struct archive *);
int
archive_write_set_format_mtree(struct archive *);
int
archive_write_set_format_pax(struct archive *);
int
archive_write_set_format_pax_restricted(struct archive *);
int
archive_write_set_format_raw(struct archive *);
int
archive_write_set_format_shar(struct archive *);
int
archive_write_set_format_shar_dump(struct archive *);
int
archive_write_set_format_ustar(struct archive *);
int
archive_write_set_format_v7tar(struct archive *);
int
archive_write_set_format_warc(struct archive *);
int
archive_write_set_format_xar(struct archive *);
int
archive_write_set_format_zip(struct archive *);
π¦ DESCRIPTION π¦
These functions set the format that will be used for the archive. The library can write a variety of common archive formats. <em>Iconic behavior.</em>
archive_write_set_format()β sets the format based on the format code (seearchive.hfor the full list of format codes). In particular, this can be used in conjunction witharchive_format()to create a new archive with the same format as an existing archive. Main character energy for cloning archive formats.archive_write_set_format_by_name()β sets the corresponding format based on the common name.archive_write_set_format_filter_by_ext()andarchive_write_set_format_filter_by_ext_def()β set both filters and format based on the output filename. Supported extensions:.7z,.zip,.jar,.cpio,.iso,.a,.ar,.tar,.tgz,.tar.gz,.tar.bz2,.tar.xz. Filename-to-format matchmaking, slay.
The rest of the format-setting squad below is literally "set the format as specified" energy β more details on the formats supported by libarchive can be found in the libarchive-formats(5) manual page.
archive_write_set_format_7zip()archive_write_set_format_ar_bsd()archive_write_set_format_ar_svr4()archive_write_set_format_cpio()archive_write_set_format_cpio_bin()archive_write_set_format_cpio_newc()archive_write_set_format_cpio_odc()archive_write_set_format_cpio_pwb()archive_write_set_format_gnutar()archive_write_set_format_iso9660()archive_write_set_format_mtree()archive_write_set_format_mtree_classic()archive_write_set_format_pax()archive_write_set_format_pax_restricted()archive_write_set_format_raw()archive_write_set_format_shar()archive_write_set_format_shar_dump()archive_write_set_format_ustar()archive_write_set_format_v7tar()archive_write_set_format_warc()archive_write_set_format_xar()archive_write_set_format_zip()
π«Ά RETURN VALUES π«Ά
These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL. Manifesting ARCHIVE_OK for u, bestie.
π ERRORS π
Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions. When things go sideways, those two are the group chat.
π SEE ALSO π
tar(1)archive_write(3)archive_write_set_options(3)libarchive(3)cpio(5)libarchive-formats(5)mtree(5)tar(5)
xoxo, your Debian bestie π β February 14, 2013. That's the source/version and date sign-off, periodt. π
π¦ 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-1017 on : a language model's rewrite of the original, under its terms