archive_write_set_format_ustar(3)

archive_write_set_format_ustar3

Functions for creating archives

Part of archive_write_format(3).

Usage

#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 *);

Library

Streaming Archive Library (libarchive, -larchive)

Overview

These functions set the format that will be used for the archive.

The library can write a variety of common archive formats.

archive_write_set_format()

Sets the format based on the format code (see archive.h for the full list of format codes). In particular, this can be used in conjunction with archive_format() to create a new archive with the same format as an existing archive.

archive_write_set_format_by_name()

Sets the corresponding format based on the common name.

archive_write_set_format_filter_by_ext() archive_write_set_format_filter_by_ext_def() Sets both filters and format based on the output filename, optionally referring to a default extension if the supplied filename does not have a known one. Supported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar, .tgz, .tar.gz, .tar.bz2, .tar.xz

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() Set the format as specified. More details on the formats supported by libarchive can be found in the libarchive-formats(5) manual page.

Return values

These functions return ARCHIVE_OK on success, or ARCHIVE_FATAL.

Errors

Detailed error codes and textual descriptions are available from the archive_errno() and archive_error_string() functions.

Releases

52 releases since FreeBSD 5.3-RELEASE; the text changed 34 times.

  1. 5.3
  2. 5.4
  3. 5.5
  4. 6.0–6.1
  5. 6.2
  6. 6.3
  7. 6.4
  8. 7.0
  9. 7.1
  10. 7.2
  11. 7.3
  12. 7.4
  13. 8.0
  14. 8.1
  15. 8.2
  16. 8.3
  17. 8.4
  18. 9.0
  19. 9.1
  20. 9.2
  21. 9.3
  22. 10.0–10.3
  23. 10.4
  24. 11.0
  25. 11.1–11.3
  26. 11.4
  27. 12.0–12.1
  28. 12.2
  29. 12.3–12.4
  30. 13.0
  31. 13.1–13.3
  32. 13.4–13.5
  33. 14.0
  34. 14.1–15.1
  35. 16.0

From base 16.0-CURRENT-20261027-61c70dc16a79 in FreeBSD 16.0-CURRENT (2026-10-27). Parsed by carta from the page's mdoc source.