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

NAME

6       zip_open - open zip archive
7

LIBRARY

9       libzip (-lzip)
10

SYNOPSIS

12       #include <zip.h>
13
14       struct zip * zip_open(const char *path, int flags, int *errorp);
15

DESCRIPTION

17       The zip archive specified by path is opened and a pointer to a
18
19       struct zip, used to manipulate the archive, is returned.  The are spec‐
20       ified by or'ing the following values, or 0 for none of them.
21
22              ZIP_CREATE     Create the archive if it does not exist.
23
24              ZIP_EXCL       Error if archive already exists.
25
26              ZIP_CHECKCONS  Perform additional consistency checks on the  ar‐
27                             chive, and error if they fail.
28
29       If an error occurs and errorp is non-NULL, it will be set to the corre‐
30       sponding error code.
31

RETURN VALUES

33       Upon successful completion zip_open returns a
34
35       struct zip pointer.  Otherwise, NULL is returned and *errorp is set  to
36       indicate the error.
37

ERRORS

39       The archive specified by path is opened unless:
40
41              [ZIP_ER_EXISTS]
42                  The file specified by path exists and ZIP_EXCL is set.
43
44              [ZIP_ER_INCONS]
45                  Inconsistencies were found in the file specified by path and
46                  ZIP_CHECKCONS was specified.
47
48              [ZIP_ER_INVAL]
49                  The path argument is NULL.
50
51              [ZIP_ER_MEMORY]
52                  Required memory could not be allocated.
53
54              [ZIP_ER_NOENT]
55                  The file specified by path does not exist and ZIP_CREATE  is
56                  not set.
57
58              [ZIP_ER_NOZIP]
59                  The file specified by path is not a zip archive.
60
61              [ZIP_ER_OPEN]
62                  The file specified by path could not be opened.
63
64              [ZIP_ER_READ]
65                  A read error occurred; see for details.
66
67              [ZIP_ER_SEEK]
68                  The file specified by path does not allow seeks.
69

SEE ALSO

71       libzip(3), zip_close(3), zip_error_to_str(3)
72

AUTHORS

74       Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
75
76
77
78NiH                            December 27, 2003                   ZIP_OPEN(3)
Impressum