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

NAME

4     libzip — library for manipulating zip archives
5

LIBRARY

7     libzip (-lzip)
8

SYNOPSIS

10     #include <zip.h>
11

DESCRIPTION

13     libzip is a library for reading, creating, and modifying zip archives.
14
15     The main design criteria for libzip were:
16     Do not create corrupt files, even in case of errors.
17     Do not delete data.
18     Be efficient.
19
20     For this reason, when modifying zip archives, libzip writes to a tempo‐
21     rary file and replaces the original zip archive atomically.
22
23     Below there are two sections listing functions: one for how to read from
24     zip archives and one for how to create/modify them.
25

FILE NAMES

27   Encoding
28     Names of files in the host file system are expected in UTF-8 encoding.
29     On Windows, variants for ASCII and UTF-16 are also available.
30
31     Names of files inside archives are by default expected in UTF-8 encoding.
32     Other encodings can be requested by using the flags ZIP_FL_ENC_CP437 and
33     ZIP_FL_ENC_RAW.
34
35     For details see the relevant man pages.
36
37   Directory Separator
38     The zip format requires the use of forward slash (‘/’) as directory sepa‐
39     rator.  Since backslash (‘\’) can be part of a valid file name on Unix
40     systems, libzip does not automatically convert them, even on Windows.  It
41     is the responsibility of the programmer to ensure that all directory sep‐
42     arators are passed as forward slashes to libzip.
43

THREAD SAFETY

45     In general, different zip archives opened by libzip are independent of
46     each other and can be used by parallel-running threads without locking.
47     If you want to use an archive from multiple threads, you have to synchro‐
48     nize access to it yourself.  If you use an archive as a source for
49     zip_file_add(3) or zip_file_replace(3), access to the target archive must
50     be synchronized with access to the source archive as well.
51

READING ZIP ARCHIVES

53   Open Archive
54     •   zip_open(3)
55     •   zip_fdopen(3)
56
57   Find Files
58     •   zip_name_locate(3)
59
60   Read Files
61     •   zip_fopen(3)
62     •   zip_fopen_encrypted(3)
63     •   zip_fopen_index(3)
64     •   zip_fopen_index_encrypted(3)
65     •   zip_fread(3)
66     •   zip_file_is_seekable(3)
67     •   zip_fseek(3) (uncompressed files only)
68     •   zip_ftell(3)
69     •   zip_fclose(3)
70
71   Close Archive
72     •   zip_close(3)
73
74   Miscellaneous
75     •   zip_stat(3)
76     •   zip_compression_method_supported(3)
77     •   zip_encryption_method_supported(3)
78     •   zip_file_get_comment(3)
79     •   zip_file_get_external_attributes(3)
80     •   zip_get_archive_comment(3)
81     •   zip_get_archive_flag(3)
82     •   zip_get_name(3)
83     •   zip_get_num_entries(3)
84     •   zip_set_default_password(3)
85     •   zip_source_pass_to_lower_layer(3)
86

CREATING/MODIFYING ZIP ARCHIVES

88   Create/Open Archive
89     •   zip_open(3)
90
91   Add/Change Files and Directories
92     •   zip_dir_add(3)
93     •   zip_file_add(3)
94     •   zip_file_replace(3)
95     •   zip_file_set_comment(3)
96     •   zip_file_set_dostime(3)
97     •   zip_file_set_external_attributes(3)
98     •   zip_file_set_encryption(3)
99     •   zip_file_set_mtime(3)
100     •   zip_set_file_compression(3)
101     •   zip_source_buffer(3)
102     •   zip_source_file(3)
103     •   zip_source_filep(3)
104     •   zip_source_free(3)
105     •   zip_source_function(3)
106     •   zip_source_layered(3)
107     •   zip_source_zip(3)
108
109   Rename Files
110     •   zip_rename(3)
111
112   Delete Files
113     •   zip_delete(3)
114
115   Revert Changes
116     •   zip_unchange(3)
117     •   zip_unchange_all(3)
118     •   zip_unchange_archive(3)
119
120   Read/Modify Extra Fields
121     •   zip_file_extra_field_delete(3)
122     •   zip_file_extra_field_delete_by_id(3)
123     •   zip_file_extra_field_get(3)
124     •   zip_file_extra_field_get_by_id(3)
125     •   zip_file_extra_field_set(3)
126     •   zip_file_extra_fields_count(3)
127     •   zip_file_extra_fields_count_by_id(3)
128
129   Close Archive (Writing)
130     •   zip_close(3)
131     •   zip_discard(3)
132
133   Miscellaneous (Writing)
134     •   zip_file_attributes_init(3)
135     •   zip_libzip_version(3)
136     •   zip_register_cancel_callback_with_state(3)
137     •   zip_register_progress_callback_with_state(3)
138     •   zip_set_archive_comment(3)
139     •   zip_set_archive_flag(3)
140     •   zip_source(3)
141

ERROR HANDLING

143     •   zip_error_strerror(3)
144     •   zip_strerror(3)
145     •   zip_file_strerror(3)
146     •   zip_file_get_error(3)
147     •   zip_get_error(3)
148     •   zip_error_init_with_code(3)
149     •   zip_error_set(3)
150     •   zip_error_set_from_source(3)
151     •   zip_error_system_type(3)
152     •   zip_errors(3)
153

AUTHORS

155     Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
156
157BSD                            December 5, 2022                            BSD
Impressum