ARCHIVE_WRITE_NEW(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_NEW(3) πŸ¦‹

okay bestie, so this is archive_write_new from section 3 of the manual β€” and it's literally the vibe-check page for functions for creating archives. yes, the whole "make an archive" era starts right here. πŸ’–


πŸ“š LIBRARY

Streaming Archive Library β€” that's libarchive, and you link it with -larchive. periodt. πŸŽ€


✨ SYNOPSIS ✨

#include <archive.h>

struct archive *
archive_write_new(void);

like, that's it. one function. no args. she's simple, she's iconic. πŸ’…


🌸 DESCRIPTION 🌸

so what does she actually do? bestie, she allocates and initializes a struct archive object that's suitable for writing a tar archive. that's the whole job. main character behaviour tbh. πŸ‘‘

if something goes wrong? you get NULL back. that's your error signal, no cap β€” check for it, fr fr. 😭

and if you wanna know everything about what a struct archive object even is (like, the full lore), go read the overview manual page for libarchive(3). she's got the deep dive. 🫢

ngl, do NOT skip the NULL check. that's not a vibe, that's a crash. πŸ’€

πŸ‘€ SEE ALSO πŸ‘€


and that's the tea, bestie β€” this page comes from Debian, dated February 2, 2012, and it lives under ARCHIVE_WRITE_NEW(3). mwah πŸ’‹

πŸ“¦ where this page comes from