ZIP_SET_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_SET_ARCHIVE_FLAG(3) ✨

okay bestie, so this is a page from the Library Functions Manual, and it's literally all about zip_set_archive_flag πŸ’… like the name says, it sets an archive flag, and yes we are going to go through every single one of them together, no skipping 🫢


πŸŽ€ NAME πŸŽ€

zip_set_archive_flag β€” set zip archive flag


πŸ“š LIBRARY πŸ“š

libzip (-lzip)

no cap, you gotta link against it πŸ‘‘


🌸 SYNOPSIS 🌸

#include <zip.h>

int
zip_set_archive_flag(zip_t *archive, zip_flags_t flag, int value);

πŸ’– DESCRIPTION πŸ’–

so the way that zip_set_archive_flag() works is it sets the flag flag for the archive archive to the value value. that's it, that's the whole vibe. set a flag, on an archive, to a value. iconic ✨

and here are the supported flags, bestie, listen up 🎧:

  • ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE β€” if this flag is cleared, the archive file gets removed when the archive is empty. if it's set, an empty archive will be created β€” which, heads up, is not recommended by the zip specification πŸ™ˆ so like, you can, but the spec is side-eyeing you the whole time.
  • ZIP_AFL_RDONLY β€” if this flag is set, no modification to the archive is allowed. periodt. and here's the tea: this flag can only be cleared if it was manually set with zip_set_archive_flag, not if the archive was opened read-only. so if you opened it read-only, that's locked in, no take-backs πŸ’€
  • ZIP_AFL_WANT_TORRENTZIP β€” if this flag is set, the archive will be written in torrentzip format. slay πŸ”₯

πŸ¦‹ RETURN VALUES πŸ¦‹

upon successful completion, 0 is returned, and -1 if an error occurred. so like, 0 = we ate, -1 = not me crying 😭


🌈 SEE ALSO 🌈


⭐ HISTORY ⭐

zip_set_archive_flag() was added in libzip 0.9. and then in libzip 0.11 the type of flag was changed from int to zip_flags_t β€” a glow-up fr fr πŸ’…

ZIP_AFL_CREATE_OR_KEEP_FILE_FOR_EMPTY_ARCHIVE and ZIP_AFL_WANT_TORRENTZIP were added in libzip 1.10.0. new arrivals, welcome to the group chat πŸŽ€


πŸ‘‘ AUTHORS πŸ‘‘

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

give them their flowers, they wrote the whole thing 🌸


πŸ’œ and that's the page, bestie! this one came from the Debian build of the libzip manual, dated July 19, 2023 β€” go off, you understood the assignment 🫢✨