ZIP_SOURCE_BEGIN_WRITE(3)

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

πŸ’– ZIP_SOURCE_BEGIN_WRITE πŸ’–

okay bestie, so this is a manual page from the Library Functions Manual β€” it's the one about zip_source_begin_write and its little sister zip_source_begin_write_cloning, both living in that iconic ZIP_SOURCE_BEGIN_WRITE(3) energy. periodt. πŸ’…


✨ NAME ✨

zip_source_begin_write, zip_source_begin_write_cloning β€” get a zip source ready for writing πŸŽ€


πŸ“š LIBRARY πŸ“š

libzip (-lzip) β€” yeah, that's the one, link against it bestie 🫢


🌸 SYNOPSIS 🌸

#include <zip.h>

int
zip_source_begin_write(zip_source_t *source);

int
zip_source_begin_write_cloning(zip_source_t *source,
    zip_uint64_t offset);

πŸ¦‹ DESCRIPTION πŸ¦‹

okay so, both of these functions β€” zip_source_begin_write() and zip_source_begin_write_cloning() β€” do one big thing: they prepare source for writing. it's giving "getting your room ready before the party" energy. usually that means making temp files or allocating buffers. like, the actual setup work. no cap. ✨

now zip_source_begin_write_cloning() is the extra one: it preserves the first offset bytes of the original file. the way that it does this efficiently? iconic. and here's the important part bestie β€” writes to source won't overwrite the original data until zip_commit_write() is called. so you're safe until you commit. πŸ”₯


πŸ‘‘ RETURN VALUES πŸ‘‘

  • on a successful completion, 0 is returned πŸŽ‰
  • otherwise, -1 is returned, and the error information in source gets set to tell you what went wrong 😭

🧚 SEE ALSO 🧚


⭐ HISTORY ⭐

  • zip_source_begin_write() was added in libzip 1.0. og behaviour. πŸ’œ
  • zip_source_begin_write_cloning() was added in libzip 1.4.0. the sequel nobody expected but everybody needed. πŸ¦‹

πŸ’œ AUTHORS πŸ’œ

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the actual main characters who wrote this. we stan. πŸ‘‘


aaaand that's the whole thing bestie!! this page came to you from the Debian fam, version vibes dated December 18, 2017, filed under ZIP_SOURCE_BEGIN_WRITE(3) πŸ’–βœ¨ go forth and write your zip sources responsibly, ily, bye!! πŸŽ€πŸ«Ά

πŸ“¦ where this page comes from