| ZIP_GET_NAME(3) | Library Functions Manual | ZIP_GET_NAME(3) |
zip_get_name — get
name of file by index
libzip (-lzip)
#include
<zip.h>
const char *
zip_get_name(zip_t
*archive, zip_uint64_t
index, zip_flags_t
flags);
The
zip_get_name()
function returns the name of the file at position
index in archive. The name is in
UTF-8 encoding unless ZIP_FL_ENC_RAW was specified
(see below).
If flags is set to
ZIP_FL_UNCHANGED, the original unchanged filename is
returned. The returned string must not be modified or freed, and becomes
invalid when archive is closed.
Additionally, the following flags are supported:
ZIP_FL_ENC_RAWZIP_FL_ENC_GUESSZIP_FL_ENC_STRICTUpon successful completion, a pointer to the name is returned.
Otherwise, NULL and the error code in
archive is set to indicate the error.
zip_get_name() fails if:
ZIP_ER_DELETED]ZIP_ER_INVAL]ZIP_FL_UNCHANGED is set.ZIP_ER_MEMORY]zip_get_name() was added in libzip 0.6. In
libzip 0.10 the type of index was changed from
int to zip_uint64_t. In libzip
0.11 the type of flags was changed from
int to zip_flags_t.
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>
| September 22, 2020 | NiH |