ZIP_SOURCE_READ(3)

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

✨ zip_source_read(3) ✨

ok so bestie, welcome to the <pink>zip_source_read</pink> page β€” that's the manual page for <pink>zip_source_read</pink> from the <lavender>Library Functions Manual</lavender>, living in <mint>libzip</mint>. grab a snack, we're reading bytes πŸ’…


🌸 NAME 🌸

zip_source_read β€” read data from a zip source πŸ¦‹


πŸ“š LIBRARY πŸ“š

libzip (-lzip) β€” link it and you're golden ✨


πŸŽ€ SYNOPSIS πŸŽ€

#include <zip.h>

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

πŸ’– DESCRIPTION πŸ’–

ok so <pink>zip_source_read()</pink> is literally the "gimme the bytes" function. it reads up to len bytes of data from source, at the current read offset, straight into the buffer data. that's it, that's the whole vibe 🫢

⚠️ but listen β€” the zip source source has to be opened for reading first, by calling zip_source_open(3). no open, no read. periodt πŸ’€

🌈 RETURN VALUES 🌈

  • βœ… if it goes well, you get the number of bytes read back. slay.
  • πŸ“ if you call <pink>zip_source_read()</pink> after you've already hit the end of the file, you get 0. that's the "nothing left bestie" signal.
  • 😭 otherwise you get -1, and the error information inside source gets set to tell you what went wrong. not the vibe, but at least it tells you.

πŸ‘€ SEE ALSO πŸ‘€

libzip(3), zip_source(5), zip_source_seek(3), zip_source_tell(3), zip_source_write(3)

go read those too, they're iconic πŸ”₯


πŸ¦‹ HISTORY πŸ¦‹

zip_source_read() was added in libzip 1.0. a legend from the start, no cap πŸ‘‘


πŸ’œ AUTHORS πŸ’œ

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


and that's the page!! this one shipped with the <purple>Debian</purple> build, dated <purple>September 28, 2021</purple>, and it's the <pink>ZIP_SOURCE_READ(3)</pink> page itself πŸŽ€ tysm for reading, go open your source before you read from it, mwah πŸ’–βœ¨

πŸ“¦ where this page comes from