1 .\" Copyright (c) 2003-2011 Tim Kientzle
2 .\" All rights reserved.
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
7 .\" 1. Redistributions of source code must retain the above copyright
8 .\" notice, this list of conditions and the following disclaimer.
9 .\" 2. Redistributions in binary form must reproduce the above copyright
10 .\" notice, this list of conditions and the following disclaimer in the
11 .\" documentation and/or other materials provided with the distribution.
13 .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
14 .\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
15 .\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
16 .\" ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
17 .\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
18 .\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
19 .\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
20 .\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
21 .\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
22 .\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
28 .Dt ARCHIVE_WRITE_FORMAT 3
31 .Nm archive_write_set_format ,
32 .Nm archive_write_set_format_7zip ,
33 .Nm archive_write_set_format_ar ,
34 .Nm archive_write_set_format_ar_bsd ,
35 .Nm archive_write_set_format_ar_svr4 ,
36 .Nm archive_write_set_format_by_name ,
37 .Nm archive_write_set_format_cpio ,
38 .Nm archive_write_set_format_cpio_bin ,
39 .Nm archive_write_set_format_cpio_newc ,
40 .Nm archive_write_set_format_cpio_odc ,
41 .Nm archive_write_set_format_cpio_pwb ,
42 .Nm archive_write_set_format_filter_by_ext ,
43 .Nm archive_write_set_format_filter_by_ext_def ,
44 .Nm archive_write_set_format_gnutar ,
45 .Nm archive_write_set_format_iso9660 ,
46 .Nm archive_write_set_format_mtree ,
47 .Nm archive_write_set_format_mtree_classic ,
48 .Nm archive_write_set_format_mtree_default ,
49 .Nm archive_write_set_format_pax ,
50 .Nm archive_write_set_format_pax_restricted ,
51 .Nm archive_write_set_format_raw ,
52 .Nm archive_write_set_format_shar ,
53 .Nm archive_write_set_format_shar_dump ,
54 .Nm archive_write_set_format_ustar ,
55 .Nm archive_write_set_format_v7tar ,
56 .Nm archive_write_set_format_warc ,
57 .Nm archive_write_set_format_xar ,
58 .Nm archive_write_set_format_zip
59 .Nd functions for creating archives
61 Streaming Archive Library (libarchive, -larchive)
65 .Fn archive_write_set_format "struct archive *" "int code"
67 .Fn archive_write_set_format_7zip "struct archive *"
69 .Fn archive_write_set_format_ar "struct archive *"
71 .Fn archive_write_set_format_ar_bsd "struct archive *"
73 .Fn archive_write_set_format_ar_svr4 "struct archive *"
75 .Fn archive_write_set_format_by_name "struct archive *" "const char *name"
77 .Fn archive_write_set_format_cpio "struct archive *"
79 .Fn archive_write_set_format_cpio_bin "struct archive *"
81 .Fn archive_write_set_format_cpio_newc "struct archive *"
83 .Fn archive_write_set_format_cpio_odc "struct archive *"
85 .Fn archive_write_set_format_cpio_pwb "struct archive *"
87 .Fn archive_write_set_format_filter_by_ext "struct archive *" "const char *filename"
89 .Fn archive_write_set_format_filter_by_ext_def "struct archive *" "const char *filename" "const char *def_ext"
91 .Fn archive_write_set_format_gnutar "struct archive *"
93 .Fn archive_write_set_format_iso9660 "struct archive *"
95 .Fn archive_write_set_format_mtree "struct archive *"
97 .Fn archive_write_set_format_pax "struct archive *"
99 .Fn archive_write_set_format_pax_restricted "struct archive *"
101 .Fn archive_write_set_format_raw "struct archive *"
103 .Fn archive_write_set_format_shar "struct archive *"
105 .Fn archive_write_set_format_shar_dump "struct archive *"
107 .Fn archive_write_set_format_ustar "struct archive *"
109 .Fn archive_write_set_format_v7tar "struct archive *"
111 .Fn archive_write_set_format_warc "struct archive *"
113 .Fn archive_write_set_format_xar "struct archive *"
115 .Fn archive_write_set_format_zip "struct archive *"
117 These functions set the format that will be used for the archive.
119 The library can write a variety of common archive formats.
120 .Bl -tag -width indent
121 .It Fn archive_write_set_format
122 Sets the format based on the format code (see
124 for the full list of format codes).
125 In particular, this can be used in conjunction with
127 to create a new archive with the same format as an existing archive.
128 .It Fn archive_write_set_format_by_name
129 Sets the corresponding format based on the common name.
131 .Fn archive_write_set_format_filter_by_ext
132 .Fn archive_write_set_format_filter_by_ext_def
134 Sets both filters and format based on the output filename.
135 Supported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar, .tgz, .tar.gz, .tar.bz2, .tar.xz
137 .Fn archive_write_set_format_7zip
138 .Fn archive_write_set_format_ar_bsd
139 .Fn archive_write_set_format_ar_svr4
140 .Fn archive_write_set_format_cpio
141 .Fn archive_write_set_format_cpio_bin
142 .Fn archive_write_set_format_cpio_newc
143 .Fn archive_write_set_format_cpio_odc
144 .Fn archive_write_set_format_cpio_pwb
145 .Fn archive_write_set_format_gnutar
146 .Fn archive_write_set_format_iso9660
147 .Fn archive_write_set_format_mtree
148 .Fn archive_write_set_format_mtree_classic
149 .Fn archive_write_set_format_pax
150 .Fn archive_write_set_format_pax_restricted
151 .Fn archive_write_set_format_raw
152 .Fn archive_write_set_format_shar
153 .Fn archive_write_set_format_shar_dump
154 .Fn archive_write_set_format_ustar
155 .Fn archive_write_set_format_v7tar
156 .Fn archive_write_set_format_warc
157 .Fn archive_write_set_format_xar
158 .Fn archive_write_set_format_zip
160 Set the format as specified.
161 More details on the formats supported by libarchive can be found in the
162 .Xr libarchive-formats 5
167 These functions return
173 Detailed error codes and textual descriptions are available from the
176 .Fn archive_error_string
181 .Xr archive_write 3 ,
182 .Xr archive_write_set_options 3 ,
185 .Xr libarchive-formats 5 ,