ZIP_SOURCE_WRITE(3)

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

πŸ’– zip_source_write(3) β€” bestie's guide to yeeting bytes into a zip source πŸ’–

okay so this is zip_source_write(3), and it lives in libzip (-lzip) πŸŽ€ it's giving "write data to zip source" energy and honestly? iconic.


✨ SYNOPSIS ✨

#include <zip.h>

zip_int64_t
zip_source_write(zip_source_t *source, const void *data,
    zip_uint64_t len);

🌸 DESCRIPTION 🌸

so like. zip_source_write() takes len bytes out of the buffer data and writes them into the zip source source, right at the current write offset. that's it. that's the whole vibe. πŸ’…

⚠️ but bestie, LISTEN β€” your source has to be prepared for writing first. you have to call zip_source_begin_write(3) before you do literally anything else. no begin_write, no write. that's the rule. 🫢

πŸ”₯ RETURN VALUES πŸ”₯

if everything slays: you get back the number of bytes written ✨

if it does NOT slay: you get -1 back, and the error info inside source gets set to tell you what went wrong 😭 (it's giving "read the error, bestie").


πŸ‘€ SEE ALSO πŸ‘€

like. the whole write-arc cinematic universe. go read them. πŸ¦‹


πŸ•°οΈ HISTORY πŸ•°οΈ

zip_source_write() was added in libzip 1.0. a true original. main character since day one. πŸ‘‘


🌈 AUTHORS 🌈

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the two legends who made this happen πŸ’œ


okay pookie that's the whole page!! this version came from the Debian peeps, dated December 18, 2017, and the manpage is literally just called ZIP_SOURCE_WRITE(3). go forth and write those bytes, you absolute icon πŸŽ€βœ¨πŸ«Ά

πŸ“¦ where this page comes from