Imported Upstream version 3.2.1
[platform/upstream/libarchive.git] / doc / html / archive_write_blocksize.3.html
1 <!-- Creator     : groff version 1.22.3 -->
2 <!-- CreationDate: Sun Jun 19 19:54:07 2016 -->
3 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
4 "http://www.w3.org/TR/html4/loose.dtd">
5 <html>
6 <head>
7 <meta name="generator" content="groff -Thtml, see www.gnu.org">
8 <meta http-equiv="Content-Type" content="text/html; charset=US-ASCII">
9 <meta name="Content-Style" content="text/css">
10 <style type="text/css">
11        p       { margin-top: 0; margin-bottom: 0; vertical-align: top }
12        pre     { margin-top: 0; margin-bottom: 0; vertical-align: top }
13        table   { margin-top: 0; margin-bottom: 0; vertical-align: top }
14        h1      { text-align: center }
15 </style>
16 <title></title>
17 </head>
18 <body>
19
20 <hr>
21
22
23 <p>ARCHIVE_WRITE_BLOCKSI... BSD Library Functions Manual
24 ARCHIVE_WRITE_BLOCKSI...</p>
25
26 <p style="margin-top: 1em"><b>NAME</b></p>
27
28
29 <p style="margin-left:6%;"><b>archive_write_get_bytes_per_block</b>,
30 <b>archive_write_set_bytes_per_block</b>,
31 <b>archive_write_get_bytes_in_last_block</b>,
32 <b>archive_write_set_bytes_in_last_block</b> &mdash;
33 functions for creating archives</p>
34
35 <p style="margin-top: 1em"><b>LIBRARY</b></p>
36
37 <p style="margin-left:6%;">Streaming Archive Library
38 (libarchive, -larchive)</p>
39
40 <p style="margin-top: 1em"><b>SYNOPSIS</b></p>
41
42 <p style="margin-left:6%;"><b>#include
43 &lt;archive.h&gt;</b></p>
44
45 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
46
47
48 <p style="margin-left:12%;"><b>archive_write_get_bytes_per_block</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
49
50 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
51
52
53 <p style="margin-left:12%;"><b>archive_write_set_bytes_per_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
54 <i>int&nbsp;bytes_per_block</i>);</p>
55
56 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
57
58
59 <p style="margin-left:12%;"><b>archive_write_get_bytes_in_last_block</b>(<i>struct&nbsp;archive&nbsp;*</i>);</p>
60
61 <p style="margin-left:6%; margin-top: 1em"><i>int</i></p>
62
63
64 <p style="margin-left:12%;"><b>archive_write_set_bytes_in_last_block</b>(<i>struct&nbsp;archive&nbsp;*</i>,
65 <i>int</i>);</p>
66
67 <p style="margin-top: 1em"><b>DESCRIPTION <br>
68 archive_write_set_bytes_per_block</b>()</p>
69
70 <p style="margin-left:17%;">Sets the block size used for
71 writing the archive data. Every call to the write callback
72 function, except possibly the last one, will use this value
73 for the length. The default is to use a block size of 10240
74 bytes. Note that a block size of zero will suppress internal
75 blocking and cause writes to be sent directly to the write
76 callback as they occur.</p>
77
78
79 <p style="margin-top: 1em"><b>archive_write_get_bytes_per_block</b>()</p>
80
81 <p style="margin-left:17%;">Retrieve the block size to be
82 used for writing. A value of -1 here indicates that the
83 library should use default values. A value of zero indicates
84 that internal blocking is suppressed.</p>
85
86
87 <p style="margin-top: 1em"><b>archive_write_set_bytes_in_last_block</b>()</p>
88
89 <p style="margin-left:17%;">Sets the block size used for
90 writing the last block. If this value is zero, the last
91 block will be padded to the same size as the other blocks.
92 Otherwise, the final block will be padded to a multiple of
93 this size. In particular, setting it to 1 will cause the
94 final block to not be padded. For compressed output, any
95 padding generated by this option is applied only after the
96 compression. The uncompressed data is always unpadded. The
97 default is to pad the last block to the full block size
98 (note that <b>archive_write_open_filename</b>() will set
99 this based on the file type). Unlike the other
100 &rsquo;&rsquo;set&rsquo;&rsquo; functions, this function can
101 be called after the archive is opened.</p>
102
103
104 <p style="margin-top: 1em"><b>archive_write_get_bytes_in_last_block</b>()</p>
105
106 <p style="margin-left:17%;">Retrieve the currently-set
107 value for last block size. A value of -1 here indicates that
108 the library should use default values.</p>
109
110 <p style="margin-top: 1em"><b>RETURN VALUES</b></p>
111
112
113 <p style="margin-left:6%;"><b>archive_write_set_bytes_per_block</b>()
114 and <b>archive_write_set_bytes_in_last_block</b>() return
115 <b>ARCHIVE_OK</b> on success, or <b>ARCHIVE_FATAL</b>.</p>
116
117
118 <p style="margin-left:6%; margin-top: 1em"><b>archive_write_get_bytes_per_block</b>()
119 and <b>archive_write_get_bytes_in_last_block</b>() return
120 currently configured block size (</p>
121
122 <p>-1 indicates the default block size ), or
123 <b>ARCHIVE_FATAL</b>.</p>
124
125 <p style="margin-top: 1em"><b>ERRORS</b></p>
126
127 <p style="margin-left:6%;">Detailed error codes and textual
128 descriptions are available from the <b>archive_errno</b>()
129 and <b>archive_error_string</b>() functions.</p>
130
131 <p style="margin-top: 1em"><b>SEE ALSO</b></p>
132
133 <p style="margin-left:6%;">tar(1), libarchive(3),
134 archive_write_set_options(3), cpio(5), mtree(5), tar(5)</p>
135
136 <p style="margin-left:6%; margin-top: 1em">BSD
137 February&nbsp;2, 2012 BSD</p>
138 <hr>
139 </body>
140 </html>