ZIP_DELETE(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_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 inside archive gets 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] β€” index is not a valid file index in archive. 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) πŸ’–πŸ¦‹βœ¨