ZIP_FILE_SET_EXTERNAL_ATTRIBUTES(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_FILE_SET_EXTERNAL_ATTRIBUTES πŸ’…

okay bestie, we're in the Library Functions Manual section of the libzip cinematic universe, and today's main character is zip_file_set_external_attributes β€” yes that name is a mouthful, no we are not shortening it, it's iconic actually. πŸŽ€


✨ NAME ✨

zip_file_set_external_attributes β€” set external attributes for a file in a zip πŸ—‚οΈβœ¨


πŸ“š LIBRARY πŸ“š

libzip (-lzip) 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

#include <zip.h>

int
zip_file_set_external_attributes(zip_t *archive, zip_uint64_t index,
    zip_flags_t flags, zip_uint8_t opsys, zip_uint32_t attributes);

🌸 DESCRIPTION 🌸

so the zip_file_set_external_attributes() function does exactly what it says on the tin, no cap: it sets the operating system and the external attributes for the file sitting at position index inside the zip archive. πŸ“

and like, right now? no flags are supported. zero. none. the flags param is lowkey just vibing there. πŸ™ˆ

if you wanna know which opsys values are even legal to pass, go check out zip_file_get_external_attributes(3) β€” it's the whole lore drop. πŸ“–βœ¨


πŸ’– RETURN VALUES πŸ’–

  • if everything goes slay: 0 is returned. periodt. βœ…
  • if it does NOT go slay: -1 is returned, and the error info inside archive gets set to tell you what went wrong. πŸ’€

πŸ”₯ ERRORS πŸ”₯

zip_file_set_external_attributes() fails β€” like, actually gives up β€” if:

  • [ZIP_ER_INVAL] β€” index is not a valid file index in archive. 🚫
  • [ZIP_ER_MEMORY] β€” the memory it needed could not be allocated. 😭
  • [ZIP_ER_RDONLY] β€” the archive was opened in read-only mode, so bestie… you literally cannot write to it. πŸ™…β€β™€οΈ

πŸ‘€ SEE ALSO πŸ‘€

libzip(3), zip_file_get_external_attributes(3) 🫢


πŸ•°οΈ HISTORY πŸ•°οΈ

zip_file_set_external_attributes() was added in libzip 0.11.2 β€” a true veteran, we stan an OG. πŸ‘‘


πŸ‘‘ AUTHORS πŸ‘‘

Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at> β€” the two icons who made this happen, show them some respect fr fr. πŸ’œ


and that's the whole page, bestie!! this lil beauty comes to you courtesy of Debian, dated December 18 β€” so go forth, set those external attributes, and stay iconic. mwah. πŸ’…βœ¨πŸŽ€