ZIP_FSEEK(3)

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

πŸ’– ZIP_FSEEK(3) πŸ’–

ok so bestie, this is the manual page for zip_fseek and zip_file_is_seekable β€” aka the "seek in file" girlies πŸ’… it lives in the Library Functions Manual, and no cap, it's shorter than your attention span but every line matters.


✨ LIBRARY ✨

libzip (-lzip) πŸŽ€ that's the one. link it and you're in.


🌸 SYNOPSIS 🌸

#include <zip.h>

zip_int8_t
zip_fseek(zip_file_t *file, zip_int64_t offset, int whence);

int
zip_file_is_seekable(zip_file_t *file);

like… that's it. two functions. iconic behavior honestly πŸ¦‹


πŸ’œ DESCRIPTION πŸ’œ

okay so the zip_fseek() function seeks to the specified offset relative to whence, just like fseek(3) does. same energy, different zip context ✨

but β€” and this is the part where you need to listen, bestie β€” zip_fseek only works on uncompressed (stored), unencrypted data. the way that compressed or encrypted data just says no 😭 when you call it on compressed or encrypted data it will return an error. not a vibe. it's giving "read the room."

the zip_file_is_seekable() function returns 1 if a file is seekable. that's the whole job. queen of knowing whether you can even do the thing πŸ’…


πŸ”₯ RETURN VALUES πŸ”₯

  • if successful, zip_fseek() returns 0 βœ…
  • otherwise, -1 is returned πŸ’€

for zip_file_is_seekable():

  • it returns 1 if a file is seekable and 0 if not πŸ‘‘
  • on an invalid argument, it returns -1 πŸ™ˆ
so like, 0 from zip_fseek = slay, -1 = not slay. and for zip_file_is_seekable, 1 = seekable, 0 = nope, -1 = you handed it something invalid fr fr.

🌈 SEE ALSO 🌈

go read these too, bestie, they're all part of the same friend group 🫢


⭐ HISTORY ⭐

  • zip_fseek() was added in libzip 1.2.0 πŸŽ€
  • zip_file_is_seekable() was added in libzip 1.9.0 🌸

growth! evolution! we love to see it ✨


πŸ’– AUTHORS πŸ’–

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

absolute legends, no notes πŸ’…


and that's the page, bestie πŸ¦‹ this came to you from Debian, dated September 11, 2024, for ZIP_FSEEK(3) β€” mwah, go forth and seek responsibly, ily πŸ’œβœ¨