1LIBZIP(3) BSD Library Functions Manual LIBZIP(3)
2
4 libzip — library for manipulating zip archives
5
7 libzip (-lzip)
8
10 #include <zip.h>
11
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
26 THREAD SAFETY
27 In general, different zip archives opened by libzip are independent of
28 each other and can be used by parallel-running threads without locking.
29 If you want to use an archive from multiple threads, you have to synchro‐
30 nize access to it yourself. If you use an archive as a source for
31 zip_file_add(3) or zip_file_replace(3), access to the target archive must
32 be synchronized with access to the source archive as well.
33
35 open archive
36 • [22mzip_open(3)
37 • [22mzip_fdopen(3)
38
39 find files
40 • [22mzip_name_locate(3)
41
42 read files
43 • [22mzip_fopen(3)
44 • [22mzip_fopen_encrypted(3)
45 • [22mzip_fopen_index(3)
46 • [22mzip_fopen_index_encrypted(3)
47 • [22mzip_fread(3)
48 • [22mzip_fseek(3) (uncompressed files only)
49 • [22mzip_ftell(3) (uncompressed files only)
50 • [22mzip_fclose(3)
51
52 close archive
53 • [22mzip_close(3)
54
55 miscellaneous
56 • [22mzip_stat(3)
57 • [22mzip_compression_method_supported(3)
58 • [22mzip_encryption_method_supported(3)
59 • [22mzip_file_get_comment(3)
60 • [22mzip_file_get_external_attributes(3)
61 • [22mzip_get_archive_comment(3)
62 • [22mzip_get_archive_flag(3)
63 • [22mzip_get_name(3)
64 • [22mzip_get_num_entries(3)
65 • [22mzip_set_default_password(3)
66
68 create/open archive
69 • [22mzip_open(3)
70
71 add/change files and directories
72 • [22mzip_dir_add(3)
73 • [22mzip_file_add(3)
74 • [22mzip_file_replace(3)
75 • [22mzip_file_set_comment(3)
76 • [22mzip_file_set_dostime(3)
77 • [22mzip_file_set_external_attributes(3)
78 • [22mzip_file_set_encryption(3)
79 • [22mzip_file_set_mtime(3)
80 • [22mzip_set_file_compression(3)
81 • [22mzip_source_buffer(3)
82 • [22mzip_source_file(3)
83 • [22mzip_source_filep(3)
84 • [22mzip_source_free(3)
85 • [22mzip_source_function(3)
86 • [22mzip_source_zip(3)
87
88 rename files
89 • [22mzip_rename(3)
90
91 delete files
92 • [22mzip_delete(3)
93
94 revert changes
95 • [22mzip_unchange(3)
96 • [22mzip_unchange_all(3)
97 • [22mzip_unchange_archive(3)
98
99 read/modify extra fields
100 • [22mzip_file_extra_field_by_id(3)
101 • [22mzip_file_extra_field_delete(3)
102 • [22mzip_file_extra_field_delete_by_id(3)
103 • [22mzip_file_extra_field_get(3)
104 • [22mzip_file_extra_field_set(3)
105 • [22mzip_file_extra_fields_count(3)
106 • [22mzip_file_extra_fields_count_by_id(3)
107
108 close archive (writing)
109 • [22mzip_close(3)
110 • [22mzip_discard(3)
111
112 miscellaneous (writing)
113 • [22mzip_file_attributes_init(3)
114 • [22mzip_libzip_version(3)
115 • [22mzip_register_cancel_callback_with_state(3)
116 • [22mzip_register_progress_callback_with_state(3)
117 • [22mzip_set_archive_comment(3)
118 • [22mzip_set_archive_flag(3)
119 • [22mzip_source(3)
120
122 • [22mzip_error_strerror(3)
123 • [22mzip_strerror(3)
124 • [22mzip_file_strerror(3)
125 • [22mzip_file_get_error(3)
126 • [22mzip_get_error(3)
127 • [22mzip_error_init_with_code(3)
128 • [22mzip_error_system_type(3)
129 • [22mzip_errors(3)
130
132 Dieter Baron <dillo@nih.at> and Thomas Klausner <tk@giga.or.at>
133
134BSD April 6, 2021 BSD