ZIP_GET_ARCHIVE_FLAG(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_GET_ARCHIVE_FLAG πŸ’–

okay bestie, so this is a page from the Library Functions Manual for zip_get_archive_flag β€” it's the lil function that tells you what status flags your zip archive is rocking. And it lives in libzip, which you link with -lzip. πŸŽ€


✨ SYNOPSIS ✨

like, here's the whole vibe of how you call it:

#include <zip.h>

int
zip_get_archive_flag(zip_t *archive, zip_flags_t flag,
    zip_flags_t flags);

🌸 DESCRIPTION 🌸

So zip_get_archive_flag() tells you whether the flag flag is set for the archive archive. No cap, that's literally it. πŸ’…

And here's the tea β€” those archive flags might have been changed already by zip_set_archive_flag(). So if you set flags to ZIP_FL_UNCHANGED, you're testing the original, unchanged flags instead. iykyk. ✨

πŸ¦‹ the supported flags, bestie πŸ¦‹

  • ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE β€” if this one is cleared, the archive file gets removed whenever the archive is empty. If it's set, then an empty archive will actually be created β€” which, heads up, the zip specification does NOT recommend. 😭 This flag is always cleared unless the user explicitly sets it with zip_set_archive_flag(3). periodt.
  • ZIP_AFL_IS_TORRENTZIP β€” the archive is in torrentzip format. slay.
  • ZIP_AFL_RDONLY β€” the archive is read-only. hands off, she's not taking edits rn. πŸ™ˆ
  • ZIP_AFL_WANT_TORRENTZIP β€” if this flag is set, the archive will be written in torrentzip format. And just like the first one, this flag is always cleared unless the user explicitly sets it with zip_set_archive_flag(3). πŸ‘‘

⭐ RETURN VALUES ⭐

  • 1 β€” yasss, flag is set for archive πŸ’–
  • 0 β€” nope, it's not set 🫢
  • -1 β€” uh oh, an error occurred πŸ’€

🌈 SEE ALSO 🌈

libzip(3), zip_set_archive_flag(3)

like, go read those too bestie, they're iconic.


🧚 HISTORY 🧚

zip_get_archive_flag() was added in libzip 0.9. Then in libzip 0.11, the type of flag was changed from int to zip_flags_t, and the type of flags was changed from int to zip_flags_t. glow-up fr fr. ✨

And ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE, ZIP_AFL_IS_TORRENTZIP, and ZIP_AFL_WANT_TORRENTZIP were added in libzip 1.10.0. the way they just kept adding flags… obsessed. πŸŽ€


πŸ‘‘ AUTHORS πŸ‘‘

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the main characters who made this happen. πŸ’œ


ok that's the whole page bestie, go forth and check your flags πŸ’…

and a lil sign-off for you: this one's from the Debian build, dated January 23, 2023. mwah. πŸ“