ZIP_SET_ARCHIVE_COMMENT(3)
β¨ ZIP_SET_ARCHIVE_COMMENT(3) β¨
okay so bestie, we're in the Library Functions Manual section of your system and today's main character is zip_set_archive_comment. yes it's a whole mood, come sit with me π«Ά
π NAME π
zip_set_archive_comment β set zip archive comment
πΈ LIBRARY πΈ
libzip (-lzip)
like, that's the library you're linking against, no cap π₯
π¦ SYNOPSIS π¦
#include <zip.h>
int
zip_set_archive_comment(zip_t *archive, const char *comment,
zip_uint16_t len);
look at her. iconic signature. three little arguments and she's gonna change your whole archive's vibe π
π DESCRIPTION π
so here's the tea: zip_set_archive_comment() sets the comment for the entire zip archive. not one file inside it, the whole girl. the archive itself. main character energy fr fr.
and listen β if comment is NULL and len is 0, the archive comment gets removed. gone. deleted. she said bye π
also important: comment must be encoded in ASCII or UTF-8. that's the vibe check it has to pass, okay?
β¨ RETURN VALUES β¨
- upon successful completion,
0is returned π - otherwise,
-1is returned and the error information inarchiveis set to indicate the error π
so like, always peek at that return value, bestie. don't just ignore her.
π ERRORS π
zip_set_archive_comment() fails if:
[ZIP_ER_INVAL]βlenis less than0or longer than the maximum comment length in a zip file (65535), orcommentis not a valid UTF-8 encoded string. so either the length is doing too much, or your string is giving invalid-encoding π¬[ZIP_ER_MEMORY]β required memory could not be allocated. the machine said "no room, bestie" πͺ¦
π SEE ALSO π
go read the whole friend group, they're all connected iykyk π§
π HISTORY π
zip_set_archive_comment() was added in libzip 0.7. and then in libzip 0.11, the type of len was changed from int to zip_uint16_t. glow-up era, honestly β¨
π AUTHORS π
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>
absolute legends, we stan π«Ά
k that's the whole page, no notes. go forth and comment your archives, just keep it ASCII or UTF-8 and under 65535 bytes, mwah π
this was the Debian build of ZIP_SET_ARCHIVE_COMMENT(3), dated December 18, 2017. periodt. π
π¦ 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) 2006-2021 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