| ZIP_FOPEN(3) | Library Functions Manual | ZIP_FOPEN(3) |
zip_fopen,
zip_fopen_index — open file
in zip archive for reading
libzip (-lzip)
#include
<zip.h>
zip_file_t *
zip_fopen(zip_t
*archive, const char
*fname, zip_flags_t
flags);
zip_file_t *
zip_fopen_index(zip_t
*archive, zip_uint64_t
index, zip_flags_t
flags);
The
zip_fopen()
function opens the file name fname in
archive. The flags argument
specifies how the name lookup should be done, according to the values are
described in
zip_name_locate(3). Also, the
following values may be
or'ed
to it.
ZIP_FL_COMPRESSEDzip_fread().ZIP_FL_UNCHANGEDThe
zip_fopen_index()
function opens the file at position index.
If encrypted data is encountered, the functions call zip_fopen_encrypted(3) or zip_fopen_index_encrypted(3) respectively, using the default password set with zip_set_default_password(3).
Upon successful completion, a struct
zip_file pointer is returned. Otherwise, NULL
is returned and the error code in archive is set to
indicate the error.
ZIP_ER_CHANGED]ZIP_ER_COMPNOTSUPP]ZIP_ER_ENCRNOTSUPP]ZIP_ER_MEMORY]ZIP_ER_NOPASSWD]ZIP_ER_READ]ZIP_ER_SEEK]ZIP_ER_WRONGPASSWD]zip_fopen().ZIP_ER_ZLIB]The function zip_fopen() may also fail and
set zip_err for any of the errors specified for the
routine
zip_name_locate(3).
The function zip_fopen_index() may also
fail with ZIP_ER_INVAL if
index is invalid.
libzip(3), zip_fclose(3), zip_fread(3), zip_fseek(3), zip_get_num_entries(3), zip_name_locate(3), zip_set_default_password(3)
zip_fopen() and
zip_fopen_index() were added in libzip 1.0.
Dieter Baron <dillo@nih.at> and Thomas Klausner <wiz@gatalith.at>
| December 18, 2017 | NiH |