ZIP_ADD(3)

πŸ“¦
version 1.11.4 Β· 3 versions
, in arch rolling, debian trixie, fedora 43, fedora 44, nixpkgs unstable, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ ZIP_ADD πŸ’…

okay so bestie, listen β€” this page is literally called zip_add, and it's here to tell you about zip_add, zip_replace β€” add file to zip archive or replace file in zip archive (obsolete interface). yeah. it's giving "vintage, but make it functional." πŸŽ€


πŸ“š LIBRARY

libzip (-lzip) β€” that's your girl, link against her and you're set. 🫢


🌸 SYNOPSIS

#include <zip.h>

zip_int64_t
zip_add(zip_t *archive, const char *name, zip_source_t *source);

int
zip_replace(zip_t *archive, zip_uint64_t index, zip_source_t *source);

look at those signatures, they're so cute. ✨


πŸ’– DESCRIPTION

okay so, real talk. The function zip_add() is the obsolete version of zip_file_add(3). Not deprecated-but-fine, not "we'll allow it" β€” obsolete. It is the same as calling zip_file_add(3) with an empty flags argument. That's it. That's the whole tea. 🍡

Similarly (and I say this with love), the zip_replace() function is the obsolete version of zip_file_replace(3). It is the same as calling zip_file_replace(3) with an empty flags argument.

so like β€” they work, they do the thing, but they're the old way. the glow-up versions are right there. go get them. πŸ’…


πŸ‘€ SEE ALSO

(the last two are the main characters here, fr fr. 🫢)


πŸ•°οΈ HISTORY

okay, storytime. πŸ“–

zip_add() was added in libzip 0.6. Then in libzip 0.10 the return type was changed from int to zip_int64_t β€” glow-up era. It was deprecated in libzip 0.11, use zip_file_add() instead. 🚫

zip_replace() was added in libzip 0.6. In libzip 0.10 the type of index was changed from int to zip_uint64_t. It was deprecated in libzip 0.11, use zip_file_replace() instead. 🚫

bestie if you're out here writing new code with these: no. stop. the deprecated flag is up for a reason. use the zip_file_* versions. periodt. πŸ’€

πŸ‘‘ AUTHORS

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the icons who built this. bow down. πŸ™‡β€β™€οΈ


and that's the whole page, bestie!! this one came from Debian, dated December 18, 2017, and the manual page itself is ZIP_ADD(3). mwah. πŸ’–βœ¨πŸŽ€