zzip_dir_fdopen(3)

πŸ“¦
version 0.13.78 Β· 4 versions
, in centos-stream 10, debian trixie, fedora 43, fedora 44, opensuse-leap 16.0, ubuntu questing, ubuntu resolute, ubuntu stonking

✨ zzip_dir_fdopen β€” the fd reopen situation πŸ’…

okay bestie, so this is a page straight out of the zziplib Function List, and today's main characters are zzip_dir_fdopen and zzip_dir_fdopen_ext_io. they do the fd reopen thing. let's get into it 🫢


🌸 NAME 🌸

zzip_dir_fdopen, zzip_dir_fdopen_ext_io β€” fd reopen, no cap.


✨ SYNOPSIS ✨

#include <zzip/lib.h>

ZZIP_DIR*
zzip_dir_fdopen(int fd, zzip_error_t* errcode_p)

ZZIP_DIR*
zzip_dir_fdopen_ext_io(int fd, zzip_error_t* errcode_p, zzip_strings_t* ext,
                       const zzip_plugin_io_t io)

πŸ¦‹ DESCRIPTION πŸ¦‹

so zzip_dir_fdopen is the function that zzip_dir_open and zzip_opendir(2) literally call. it opens the zip-archive as specified with the fd, and that fd points to a file that's already open, iykyk. then zzip_dir_fdopen goes and searches + parses the zip's central directory. iconic behavior honestly.

⚠️ NOTE: refcount is zero, so an _open/_close pair will also delete this _dirhandle. like, the close really said "and I took that personally" 😭 plan accordingly.

and the zzip_dir_fdopen_ext_io function? she uses explicit ext and io instead of the internal defaults. setting those to zero is equivalent to just calling zzip_dir_fdopen. so if you're feeling lazy, zero is your bestie. πŸ’–


πŸ‘‘ AUTHOR πŸ‘‘

Guido Draheim <guidod@gmx.de> and Tomi Ollila <too@iki.fi> β€” the legends behind all this.


Copyright (c) Guido Draheim, use under copyleft (LGPL,MPL).


okay that's the whole page, bestie, go forth and parse those central directories 🌈✨

zziplib 0.13.78 β€” yeah this whole thing is from the 0.13.78 era, dated and official, mwah πŸ’‹ thanks for reading, ily, bye πŸ¦‹πŸ’œ