]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/blob - contrib/libarchive/libarchive/archive_write_format.3
MFC r299529,r299540,r299576,r299896:
[FreeBSD/stable/10.git] / contrib / libarchive / libarchive / archive_write_format.3
1 .\" Copyright (c) 2003-2011 Tim Kientzle
2 .\" All rights reserved.
3 .\"
4 .\" Redistribution and use in source and binary forms, with or without
5 .\" modification, are permitted provided that the following conditions
6 .\" are met:
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.
12 .\"
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
23 .\" SUCH DAMAGE.
24 .\"
25 .\" $FreeBSD$
26 .\"
27 .Dd February 14, 2013
28 .Dt ARCHIVE_WRITE_FORMAT 3
29 .Os
30 .Sh NAME
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_newc ,
39 .Nm archive_write_set_format_filter_by_ext ,
40 .Nm archive_write_set_format_filter_by_ext_def ,
41 .Nm archive_write_set_format_gnutar ,
42 .Nm archive_write_set_format_iso9660 ,
43 .Nm archive_write_set_format_mtree ,
44 .Nm archive_write_set_format_mtree_classic ,
45 .Nm archive_write_set_format_mtree_default ,
46 .Nm archive_write_set_format_pax ,
47 .Nm archive_write_set_format_pax_restricted ,
48 .Nm archive_write_set_format_raw ,
49 .Nm archive_write_set_format_shar ,
50 .Nm archive_write_set_format_shar_dump ,
51 .Nm archive_write_set_format_ustar ,
52 .Nm archive_write_set_format_v7tar ,
53 .Nm archive_write_set_format_warc ,
54 .Nm archive_write_set_format_xar ,
55 .Nm archive_write_set_format_zip ,
56 .Nd functions for creating archives
57 .Sh LIBRARY
58 Streaming Archive Library (libarchive, -larchive)
59 .Sh SYNOPSIS
60 .In archive.h
61 .Ft int
62 .Fn archive_write_set_format "struct archive *" "int code"
63 .Ft int
64 .Fn archive_write_set_format_7zip "struct archive *"
65 .Ft int
66 .Fn archive_write_set_format_ar "struct archive *"
67 .Ft int
68 .Fn archive_write_set_format_ar_bsd "struct archive *"
69 .Ft int
70 .Fn archive_write_set_format_ar_svr4 "struct archive *"
71 .Ft int
72 .Fn archive_write_set_format_by_name "struct archive *" "const char *name"
73 .Ft int
74 .Fn archive_write_set_format_cpio "struct archive *"
75 .Ft int
76 .Fn archive_write_set_format_cpio_newc "struct archive *"
77 .Ft int
78 .Fn archive_write_set_format_filter_by_ext "struct archive *" "const char *filename"
79 .Ft int
80 .Fn archive_write_set_format_filter_by_ext_def "struct archive *" "const char *filename" "const char *def_ext"
81 .Ft int
82 .Fn archive_write_set_format_gnutar "struct archive *"
83 .Ft int
84 .Fn archive_write_set_format_iso9660 "struct archive *"
85 .Ft int
86 .Fn archive_write_set_format_mtree "struct archive *"
87 .Ft int
88 .Fn archive_write_set_format_pax "struct archive *"
89 .Ft int
90 .Fn archive_write_set_format_pax_restricted "struct archive *"
91 .Ft int
92 .Fn archive_write_set_format_raw "struct archive *"
93 .Ft int
94 .Fn archive_write_set_format_shar "struct archive *"
95 .Ft int
96 .Fn archive_write_set_format_shar_dump "struct archive *"
97 .Ft int
98 .Fn archive_write_set_format_ustar "struct archive *"
99 .Ft int
100 .Fn archive_write_set_format_v7tar "struct archive *"
101 .Ft int
102 .Fn archive_write_set_format_warc "struct archive *"
103 .Ft int
104 .Fn archive_write_set_format_xar "struct archive *"
105 .Ft int
106 .Fn archive_write_set_format_zip "struct archive *"
107 .Sh DESCRIPTION
108 These functions set the format that will be used for the archive.
109 .Pp
110 The library can write a variety of common archive formats.
111
112 .Bl -tag -width indent
113 .It Fn archive_write_set_format
114 Sets the format based on the format code (see
115 .Pa archive.h
116 for the full list of format codes).
117 In particular, this can be used in conjunction with
118 .Fn archive_format
119 to create a new archive with the same format as an existing archive.
120 .It Fn archive_write_set_format_by_name
121 Sets the corresponding format based on the common name.
122 .It Xo
123 .Fn archive_write_set_format_filter_by_ext ,
124 .Fn archive_write_set_format_filter_by_ext_def
125 .Xc
126 Sets both filters and format based on the output filename.
127 Supported extensions: .7z, .zip, .jar, .cpio, .iso, .a, .ar, .tar, .tgz, .tar.gz, .tar.bz2, .tar.xz
128 .It Xo
129 .Fn archive_write_set_format_7zip
130 .Fn archive_write_set_format_ar_bsd ,
131 .Fn archive_write_set_format_ar_svr4 ,
132 .Fn archive_write_set_format_cpio
133 .Fn archive_write_set_format_cpio_newc
134 .Fn archive_write_set_format_gnutar
135 .Fn archive_write_set_format_iso9660
136 .Fn archive_write_set_format_mtree
137 .Fn archive_write_set_format_mtree_classic
138 .Fn archive_write_set_format_pax
139 .Fn archive_write_set_format_pax_restricted
140 .Fn archive_write_set_format_raw
141 .Fn archive_write_set_format_shar
142 .Fn archive_write_set_format_shar_dump
143 .Fn archive_write_set_format_ustar
144 .Fn archive_write_set_format_v7tar
145 .Fn archive_write_set_format_warc
146 .Fn archive_write_set_format_xar
147 .Fn archive_write_set_format_zip
148 .Xc
149 Set the format as specified.
150 More details on the formats supported by libarchive can be found in the
151 .Xr libarchive-formats 5
152 manual page.
153 .El
154 .\"
155 .Sh RETURN VALUES
156 These functions return
157 .Cm ARCHIVE_OK
158 on success, or
159 .Cm ARCHIVE_FATAL .
160 .\"
161 .Sh ERRORS
162 Detailed error codes and textual descriptions are available from the
163 .Fn archive_errno
164 and
165 .Fn archive_error_string
166 functions.
167 .\"
168 .Sh SEE ALSO
169 .Xr tar 1 ,
170 .Xr libarchive 3 ,
171 .Xr archive_write 3 ,
172 .Xr archive_write_set_options 3 ,
173 .Xr cpio 5 ,
174 .Xr libarchive-formats 5 ,
175 .Xr mtree 5 ,
176 .Xr tar 5