ZIP_SOURCE_COMMIT_WRITE(3)

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

πŸ’– ZIP_SOURCE_COMMIT_WRITE β€” the "okay we're DONE here" function πŸ’–

okay bestie so we're in the Library Functions Manual, section 3, and today's main character is zip_source_commit_write β€” the function that goes "yeah that's it, that's the whole thing, ship it" πŸŽ€


✨ NAME ✨

zip_source_commit_write β€” finalize changes to zip source πŸ¦‹

no literally that's the whole vibe. you write stuff, then you commit it. periodt.


🌈 LIBRARY 🌈

libzip (-lzip) β€” yeah you gotta link it, don't forget, i've watched people forget πŸ’€


🌸 SYNOPSIS 🌸

#include <zip.h>

int
zip_source_commit_write(zip_source_t *source);

πŸ‘‘ DESCRIPTION πŸ‘‘

so the function zip_source_commit_write() finishes writing data to source and replaces the original with the newly written data. ✨

that's it. that's the glow up. you were writing into a temp-ish zone, and this is the moment you go "actually no, this IS the real one now" and the original gets swapped out for the new hotness. it's giving makeover reveal montage πŸ’…

not me calling it early β€” if you haven't finished writing, don't commit. that's not in the manual, that's just me being your friend. πŸ™ˆ

⭐ RETURN VALUES ⭐

  • slay β€” upon successful completion, 0 is returned. 🫢
  • not slay β€” otherwise, -1 is returned and the error information in source is set to indicate the error. 😭

πŸ”₯ SEE ALSO πŸ”₯

go read these next, bestie, they're the whole friend group:

iykyk 🌈


🧚 HISTORY 🧚

zip_source_commit_write() was added in libzip 1.0. iconic behavior since day one, no cap πŸ’œ


πŸ’… AUTHORS πŸ’…

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the two legends who wrote this. bow down πŸ‘‘


and that's the tea πŸ“ this page came to you from the Debian crew, dated December 18, 2017, and it lives at page ZIP_SOURCE_COMMIT_WRITE(3) in the Library Functions Manual. mwah, go commit something βœ¨πŸ’–πŸŽ€

πŸ“¦ where this page comes from