1ZIP_FOPEN(3)               Library Functions Manual               ZIP_FOPEN(3)
2
3
4

NAME

6       zip_fopen , - .Nm zip_fopen_index open file in zip archive for reading
7

LIBRARY

9       libzip (-lzip)
10

SYNOPSIS

12       #include <zip.h>
13
14       struct zip_file * zip_fopen(struct zip *archive, const char *fname, int
15       flags);
16
17       struct zip_file *  zip_fopen_index(struct  zip  *archive,  zip_uint64_t
18       index, int flags);
19

DESCRIPTION

21       The zip_fopen function opens the file name fname in archive.  The flags
22       argument specifies how the name lookup should be done, according to the
23       values are described in zip_name_locate(3).  Also, the following values
24       may be or'ed to it.
25
26              ZIP_FL_COMPRESSED  Read the compressed data.  Otherwise the data
27                                 is uncompressed by zip_fread.
28
29              ZIP_FL_UNCHANGED   Read  the original data from the zip archive,
30                                 ignoring any changes made to the file.
31
32       The zip_fopen_index function opens the file at position index.
33
34       If   encrypted   data    is    encountered,    the    functions    call
35       zip_fopen_encrypted(3)  or  zip_fopen_index_encrypted(3)  respectively,
36       using the default password set with zip_set_default_password(3).
37

RETURN VALUES

39       Upon successful completion, a
40
41       struct zip_file pointer is returned.  Otherwise, NULL is  returned  and
42       the error code in archive is set to indicate the error.
43

ERRORS

45              [ZIP_ER_CHANGED]
46                  The file data has been changed.
47
48              [ZIP_ER_COMPNOTSUPP]
49                  The compression method used is not supported.
50
51              [ZIP_ER_ENCRNOTSUPP]
52                  The encryption method used is not supported.
53
54              [ZIP_ER_MEMORY]
55                  Required memory could not be allocated.
56
57              [ZIP_ER_READ]
58                  A file read error occurred.
59
60              [ZIP_ER_SEEK]
61                  A file seek error occurred.
62
63              [ZIP_ER_ZLIB]
64                  Initializing the zlib stream failed.
65
66       The  function  zip_fopen  may  also  fail and set for any of the errors
67       specified for the routine zip_name_locate(3).
68
69       The function zip_fopen_index may also fail with ZIP_ER_INVAL  if  index
70       is invalid.
71

SEE ALSO

73       libzip(3),    zip_fclose(3),    zip_fread(3),   zip_get_num_entries(3),
74       zip_name_locate(3), zip_set_default_password(3)
75

AUTHORS

77       Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
78
79
80
81NiH                            February 14, 2011                  ZIP_FOPEN(3)
Impressum