ZIP_SOURCE_TELL_WRITE(3)

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

πŸ’– ZIP_SOURCE_TELL_WRITE(3) πŸ’–

okay bestie, so this is the manual page for zip_source_tell_write(3) and it's genuinely one of the cutest little functions in libzip. no cap. let's get into it 🫢


✨ NAME ✨

zip_source_tell_write β€” report current write offset in zip source

basically it's the "where am I rn" of writing to a zip source. main character energy: it knows its position at all times πŸ’…


πŸ“š LIBRARY πŸ“š

libzip (-lzip)

yeah so you gotta link against libzip with -lzip when you compile. that's the vibe. ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <zip.h>

zip_int64_t
zip_source_tell_write(zip_source_t *source);

look at her. so simple. so iconic. πŸ¦‹


🌸 DESCRIPTION 🌸

so, the function zip_source_tell_write() returns the current write offset for source. that's it. that's the whole thing. it tells you where you're at when you're writing. ✨

and here's the slay part: the return value can be passed to zip_source_seek_write(3) with whence set to SEEK_SET to return to the same location in the source. so it's like dropping a pin πŸ“ on your fave spot so you can come back to it later. literally so useful. iykyk.


πŸ’œ RETURN VALUES πŸ’œ

  • upon successful completion, the current write offset is returned. ate. πŸ‘‘
  • otherwise, -1 is returned and the error information in source is set to indicate the error. 😭 so yeah, if you see a -1, something went wrong and source is holding the receipts.
bestie. check that error info. don't just ignore a -1 and move on. that's not the vibe. πŸ™ˆ

πŸ¦‹ SEE ALSO πŸ¦‹

the whole friend group fr fr. go read them too, they're all part of the same storyline 🌈


⭐ HISTORY ⭐

zip_source_tell_write() was added in libzip 1.0. so she's been around. a legend from the start πŸ’–


πŸ’… AUTHORS πŸ’…

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>

shoutout to the icons who made this happen πŸŽ€


and that's the whole page, bestie! this one shipped on the Debian side back on December 18, 2017, and the manual itself lives with libzip. periodt. πŸ’œβœ¨πŸŒΈ

πŸ“¦ where this page comes from