ZIP_GET_ARCHIVE_FLAG(3)
π 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 withzip_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 withzip_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. π
π¦ where this page comes from
- arch rolling: libzip 1.11.4-1 Β· BSD
- debian trixie: libzip-dev 1.11.3-2 Β· BSD-3-Clause
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 43: libzip-devel 1.11.4-2.fc43 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- fedora 44: libzip-devel 1.11.4-3.fc44 Β· BSD-3-Clause
- nixpkgs unstable: libzip 1.11.4
- ubuntu questing: libzip-dev 1.11.3-2
- ubuntu resolute: libzip-dev 1.11.4-2 Β· BSD-3-Clause
- ubuntu stonking: libzip-dev 1.11.4-2build1 Β· BSD-3-Clause
- Copyright (C) 2008-2017 Dieter Baron and Thomas Klausner
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms