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

NAME

6       zip_close - close zip archive
7

LIBRARY

9       libzip (-lzip)
10

SYNOPSIS

12       #include <zip.h>
13
14       int zip_close(struct zip *archive);
15

DESCRIPTION

17       The  zip_close  function  closes archive and frees the memory allocated
18       for it.  If any files within were changed, those changes are written to
19       disk  first.   If writing changes fails, zip_close fails and archive is
20       left unchanged.  If archive contains no files, the file  is  completely
21       removed (no empty archive is written).
22

RETURN VALUES

24       Upon  successful  completion  0 is returned.  Otherwise, -1 is returned
25       and the error code in archive is set to indicate the error.
26

ERRORS

28       zip_close will fail if:
29
30              [ZIP_ER_EOF]
31                  Unexpected end-of-file found while reading from a file.
32
33              [ZIP_ER_INTERNAL]
34                  The callback function of an added or replaced file  returned
35                  an error but failed to report which.
36
37              [ZIP_ER_INVAL]
38                  The path argument is NULL.
39
40              [ZIP_ER_MEMORY]
41                  Required memory could not be allocated.
42
43              [ZIP_ER_NOZIP]
44                  File is not a zip archive.
45
46              [ZIP_ER_READ]
47                  A file read failed.
48
49              [ZIP_ER_RENAME]
50                  A temporary file could not be renamed to its final name.
51
52              [ZIP_ER_SEEK]
53                  A file seek failed.
54
55              [ZIP_ER_TMPOPEN]
56                  A temporary file could not be created.
57
58              [ZIP_ER_WRITE]
59                  A file write failed.
60
61              [ZIP_ER_ZLIB]
62                  An  error  occurred  while  (de)compressing  a  stream  with
63                  zlib(3).
64       Additionally, any errors returned by the callback function for added or
65       replaced files will be passed back.
66

SEE ALSO

68       libzip(3),   zip_error_get(3),   zip_fdopen(3),  zip_open(3),  zip_str‐
69       error(3)
70

AUTHORS

72       Dieter Baron <dillo@giga.or.at> and Thomas Klausner <tk@giga.or.at>
73
74
75
76NiH                            February 15, 2009                  ZIP_CLOSE(3)
Impressum