ZIP_DELETE(3)
π zip_delete(3) β Library Functions Manual
okay bestie, welcome to the group chat where we learn how to yeet a file out of a zip archive. this is zip_delete, from the Library Functions Manual, and she's iconic, she's simple, she's giving "one job, done perfectly." π
β¨ NAME β¨
zip_delete β delete file from zip archive ποΈβ¨
π LIBRARY π
libzip (-lzip) β that's the vibe, that's the squad you're linking against π«Ά
πΈ SYNOPSIS πΈ
#include <zip.h>
int
zip_delete(zip_t *archive, zip_uint64_t index);
look at her. two params. no drama. no cap. π₯
π DESCRIPTION π
okay so the way this works is so clean: the file sitting at position index inside the zip archive archive gets marked as deleted. that's it. that's the whole function. she said "you're outta here" and moved on with her life π
π¦ RETURN VALUES π¦
- if it goes well?
0. slay. perfect. no notes. β¨ - if it does not go well?
-1, and the error code insidearchivegets set to tell you exactly what went wrong. she's not gonna ghost you, she's gonna tell you the tea π
π¨ ERRORS π¨
zip_delete() fails if:
[ZIP_ER_INVAL]βindexis not a valid file index inarchive. bestie you pointed at a file that doesn't exist, and she is Not Having It π
π SEE ALSO π
go read those too, they're part of the lore iykyk π
π HISTORY π
zip_delete() was added in libzip 0.6. then in libzip 0.10, the type of index was changed from int to zip_uint64_t. a glow-up, honestly. she grew. she evolved. periodt. π
π AUTHORS π
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β the two legends who made this possible, we stan π
and that's the whole page, bestie π this came to you from Debian, dated December 18, 2017 β old but gold, fr fr. now go delete something (a file index, specifically, not your friendships) ππ¦β¨
π¦ 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) 2003-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