get name of file by index
const char *
() function returns the name
of the file at position index
. The name is in UTF-8 encoding unless
was specified (see below).
is set to
, the original unchanged
filename is returned. The returned string must not be modified or freed, and
becomes invalid when archive
Additionally, the following flags
- Return the unmodified names as it is in the ZIP archive.
- (Default.) Guess the encoding of the name in the ZIP archive and convert
it to UTF-8, if necessary.
- Follow the ZIP specification and expect CP-437 encoded names in the ZIP
archive (except if they are explicitly marked as UTF-8). Convert it to
: ASCII is a subset of both CP-437 and UTF-8.
Upon successful completion, a pointer to the name is returned. Otherwise,
and the error code in
is set to indicate the error.
() fails if:
- index refers to a file that has been
- index is not a valid file index in
index points to an added file and
ZIP_FL_UNCHANGED is set.
- Required memory could not be allocated.
() was added in libzip 0.6. In
libzip 0.10 the type of index
. In libzip 0.11 the type of
was changed from
and Thomas Klausner