1 .\" Automatically generated from an mdoc input file. Do not edit.
2 .\" ziptool.mdoc -- modify zip archives in multiple ways
3 .\" Copyright (C) 2016-2022 Dieter Baron and Thomas Klausner
5 .\" This file is part of libzip, a library to manipulate ZIP archives.
6 .\" The authors can be contacted at <libzip@nih.at>
8 .\" Redistribution and use in source and binary forms, with or without
9 .\" modification, are permitted provided that the following conditions
11 .\" 1. Redistributions of source code must retain the above copyright
12 .\" notice, this list of conditions and the following disclaimer.
13 .\" 2. Redistributions in binary form must reproduce the above copyright
14 .\" notice, this list of conditions and the following disclaimer in
15 .\" the documentation and/or other materials provided with the
17 .\" 3. The names of the authors may not be used to endorse or promote
18 .\" products derived from this software without specific prior
19 .\" written permission.
21 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHORS ``AS IS'' AND ANY EXPRESS
22 .\" OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
23 .\" WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
24 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY
25 .\" DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
26 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE
27 .\" GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
28 .\" INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER
29 .\" IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
30 .\" OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN
31 .\" IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
33 .TH "ZIPTOOL" "1" "March 15, 2022" "NiH" "General Commands Manual"
38 \- modify zip archives
43 [\fB\-l\fR\ \fIlength\fR]
44 [\fB\-o\fR\ \fIoffset\fR]
46 \fBcommand\fR\ [\fIcommand-args\ ...\fR]
47 [\fBcommand\fR\ [\fIcommand-args\ ...\fR]\ ...]
50 modifies the zip archive
59 Check zip archive consistency when opening it.
62 Error if archive already exists (only useful with
66 Guess file name encoding (for
73 \fB\-l\fR \fIlength\fR
81 Create archive if it doesn't exist.
85 \fB\-o\fR \fIoffset\fR
86 Start reading input archive from
92 Print raw file name encoding without translation (for
97 Follow file name convention strictly (for
102 Disregard current file contents, if any.
104 use this with care, it deletes all existing file contents when
105 you modify the archive.
107 For all commands below, the index is zero-based.
108 In other words, the first entry in the zip archive has index 0.
110 Supported commands and arguments are:
112 \fBadd\fR \fIname content\fR
117 from the command line as data.
119 \fBadd_dir\fR \fIname\fR
123 \fBadd_file\fR \fIname file_to_add offset len\fR
130 as input data, starting at
133 \fBadd_from_zip\fR \fIname archivename index offset len\fR
136 to archive using data from another zip archive
138 using the entry with index
145 \fBcat\fR \fIindex\fR
146 Output file contents for entry
150 \fBcount_extra\fR \fIindex flags\fR
151 Print the number of extra fields for archive entry
156 \fBcount_extra_by_id\fR \fIindex extra_id flags\fR
157 Print number of extra fields of type
164 \fBdelete\fR \fIindex\fR
169 \fBdelete_extra\fR \fIindex extra_idx flags\fR
170 Remove extra field number
177 \fBdelete_extra_by_id\fR \fIindex extra_id extra_index flags\fR
178 Remove extra field number
187 \fBget_archive_comment\fR
188 Print archive comment.
190 \fBget_extra\fR \fIindex extra_index flags\fR
198 \fBget_extra_by_id\fR \fIindex extra_id extra_index flags\fR
208 \fBget_file_comment\fR \fIindex\fR
209 Get file comment for archive entry
212 \fBget_num_entries\fR \fIflags\fR
213 Print number of entries in archive using
216 \fBname_locate\fR \fIname flags\fR
217 Find entry in archive with the filename
223 \fBrename\fR \fIindex name\fR
229 \fBreplace_file_contents\fR \fIindex data\fR
230 Replace file contents for archive entry
235 \fBset_archive_comment\fR \fIcomment\fR
236 Set archive comment to
239 \fBset_extra\fR \fIindex extra_id extra_index flags value\fR
240 Set extra field number
251 \fBset_file_comment\fR \fIindex comment\fR
252 Set file comment for archive entry
257 \fBset_file_compression\fR \fIindex method compression_flags\fR
258 Set file compression method for archive entry
263 \fIcompression_flags\fR.
266 \fIcompression_flags\fR
269 \fBset_file_encryption\fR \fIindex method password\fR
270 Set file encryption method for archive entry
277 \fBset_file_mtime\fR \fIindex timestamp\fR
278 Set file modification time for archive entry
283 \fBset_file_mtime_all\fR \fItimestamp\fR
284 Set file modification time for all archive entries to UNIX mtime
287 \fBset_password\fR \fIpassword\fR
288 Set default password for encryption/decryption to
291 \fBstat\fR \fIindex\fR
292 Print information about archive entry
295 Some commands take flag arguments. Each character in the argument sets the corresponding flag. Use 0 or the empty string for no flags.
302 \fRZIP_FL_ENC_CP437\fR
305 \fRZIP_FL_ENC_UTF_8\fR
323 \fRZIP_FL_ENC_STRICT\fR
326 \fRZIP_FL_UNCHANGED\fR
329 .SS "Compression Methods"
330 Some commands take compression method arguments.
331 Supported methods are:
345 .SS "Encryption Methods"
346 Some commands take encryption method arguments.
347 Supported methods are:
366 The \fBziptool\fR utility exits\~0 on success, and\~>0 if an error occurs.
373 \(lqThis is a test.\en\(rq
376 is replaced with a newline character:
380 ziptool testbuffer.zip add teststring.txt \\"This is a test.\en\\"
384 Delete the first file from the zip archive
389 ziptool testfile.zip delete 0
398 was added in libzip 1.1.
400 Dieter Baron <\fIdillo@nih.at\fR>
402 Thomas Klausner <\fItk@giga.or.at\fR>