1<!-- Creator     : groff version 1.22.4 -->
2<!-- CreationDate: Sun Aug 22 23:03:26 2021 -->
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
24ARCHIVE_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;
33functions 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>
68archive_write_set_bytes_per_block</b>()</p>
69
70<p style="margin-left:17%;">Sets the block size used for
71writing the archive data. Every call to the write callback
72function, except possibly the last one, will use this value
73for the length. The default is to use a block size of 10240
74bytes. Note that a block size of zero will suppress internal
75blocking and cause writes to be sent directly to the write
76callback 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
82used for writing. A value of -1 here indicates that the
83library should use default values. A value of zero indicates
84that 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
90writing the last block. If this value is zero, the last
91block will be padded to the same size as the other blocks.
92Otherwise, the final block will be padded to a multiple of
93this size. In particular, setting it to 1 will cause the
94final block to not be padded. For compressed output, any
95padding generated by this option is applied only after the
96compression. The uncompressed data is always unpadded. The
97default is to pad the last block to the full block size
98(note that <b>archive_write_open_filename</b>() will set
99this based on the file type). Unlike the other
100&ldquo;set&rdquo; functions, this function can be called
101after 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
107value for last block size. A value of -1 here indicates that
108the 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>()
114and <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>()
119and <b>archive_write_get_bytes_in_last_block</b>() return
120currently 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
128descriptions are available from the <b>archive_errno</b>()
129and <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),
134archive_write_set_options(3), libarchive(3), cpio(5),
135mtree(5), tar(5)</p>
136
137<p style="margin-left:6%; margin-top: 1em">BSD
138February&nbsp;2, 2012 BSD</p>
139<hr>
140</body>
141</html>
142