1ZIP_FDOPEN(3)            BSD Library Functions Manual            ZIP_FDOPEN(3)
2

NAME

4     zip_fdopen — open zip archive using open file descriptor
5

LIBRARY

7     libzip (-lzip)
8

SYNOPSIS

10     #include <zip.h>
11
12     zip_t *
13     zip_fdopen(int fd, int flags, int *errorp);
14

DESCRIPTION

16     The zip archive specified by the open file descriptor fd is opened and a
17     pointer to a struct zip, used to manipulate the archive, is returned.  In
18     contrast to zip_open(3), using zip_fdopen the archive can only be opened
19     in read-only mode.  The fd argument may not be used any longer after
20     calling zip_fdopen.  The flags are specified by or'ing the following val‐
21     ues, or 0 for none of them.
22
23           ZIP_CHECKCONS  Perform additional stricter consistency checks on
24                          the archive, and error if they fail.
25
26     If an error occurs and errorp is non-NULL, it will be set to the corre‐
27     sponding error code.
28

RETURN VALUES

30     Upon successful completion zip_fdopen() returns a struct zip pointer, and
31     fd should not be used any longer, nor passed to close(2).  Otherwise,
32     NULL is returned and *errorp is set to indicate the error.  In the error
33     case, fd remains unchanged.
34

ERRORS

36     The file specified by fd is prepared for use by libzip(3) unless:
37
38     [ZIP_ER_INCONS]    Inconsistencies were found in the file specified by
39                        path.  This error is often caused by specifying
40                        ZIP_CHECKCONS but can also happen without it.
41
42     [ZIP_ER_INVAL]     The flags argument is invalid.  Not all zip_open(3)
43                        flags are allowed for zip_fdopen, see DESCRIPTION.
44
45     [ZIP_ER_MEMORY]    Required memory could not be allocated.
46
47     [ZIP_ER_NOZIP]     The file specified by fd is not a zip archive.
48
49     [ZIP_ER_OPEN]      The file specified by fd could not be prepared for use
50                        by libzip(3).
51
52     [ZIP_ER_OPNOTSUPP]
53                        This functionality has been disabled at compile time.
54
55     [ZIP_ER_READ]      A read error occurred; see errno for details.
56
57     [ZIP_ER_SEEK]      The file specified by fd does not allow seeks.
58

SEE ALSO

60     libzip(3), zip_close(3), zip_error_strerror(3), zip_open(3)
61

HISTORY

63     zip_fdopen() was added in libzip 1.0.
64

AUTHORS

66     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
67
68BSD                           September 23, 2022                           BSD
Impressum