ARCHIVE_WRITE_HEADER(3)

πŸ“¦
version 3.8.11 Β· 2 versions
, in alpine 3.22, alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, debian trixie, fedora 43, fedora 44, freebsd 14.5, freebsd 15.1, nixos 26.05, nixpkgs unstable, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

πŸ’– ARCHIVE_WRITE_HEADER(3) πŸ’–

okay bestie, so this one lives in the Library Functions Manual and it's literally all about creating archives ✨


πŸŽ€ LIBRARY πŸŽ€

Streaming Archive Library β€” that's libarchive, and you link it with -larchive 🫢


✨ SYNOPSIS ✨

#include <archive.h>

int
archive_write_header(struct archive *, struct archive_entry *);

🌸 DESCRIPTION 🌸

So what this does is it builds a header and writes it out, using the data you already stuffed into the struct archive_entry you're passing in. that's the whole vibe πŸ’…

ngl if you need to know how to actually make and fill up a struct archive_entry in the first place, go read archive_entry(3) β€” it's got you, i promise πŸ¦‹


πŸ’« RETURN VALUES πŸ’«

She returns ARCHIVE_OK when everything slays. and if it doesn't, you get one of these instead:

  • ARCHIVE_RETRY β€” for operations that might actually work if you just try again. like, it's not over, bestie, run it back πŸ”
  • ARCHIVE_WARN β€” unusual conditions that don't stop you from doing more stuff. weird but we move πŸ™ˆ
  • ARCHIVE_FATAL β€” serious errors that make any remaining operations impossible. no coming back from this one, it's giving end of the line πŸ’€

😭 ERRORS 😭

want the receipts? the detailed error codes and the textual descriptions are all available from the archive_errno() and archive_error_string() functions. she will tell you exactly what went wrong, fr fr πŸ”₯


πŸ‘‘ SEE ALSO πŸ‘‘

tar(1), archive_write_set_options(3), libarchive(3), cpio(5), mtree(5), tar(5)


and that's the whole page, babe πŸ’œ this one's from the Debian crew, dated February 2, 2012, and it's filed under ARCHIVE_WRITE_HEADER(3) β€” go write some headers, main character πŸ§šπŸ’–

πŸ“¦ where this page comes from