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_BLOCKSIZE 3
31 .Nm archive_write_get_bytes_per_block ,
32 .Nm archive_write_set_bytes_per_block ,
33 .Nm archive_write_get_bytes_in_last_block ,
34 .Nm archive_write_set_bytes_in_last_block
35 .Nd functions for creating archives
37 Streaming Archive Library (libarchive, -larchive)
41 .Fn archive_write_get_bytes_per_block "struct archive *"
43 .Fn archive_write_set_bytes_per_block "struct archive *" "int bytes_per_block"
45 .Fn archive_write_get_bytes_in_last_block "struct archive *"
47 .Fn archive_write_set_bytes_in_last_block "struct archive *" "int"
49 .Bl -tag -width indent
50 .It Fn archive_write_set_bytes_per_block
51 Sets the block size used for writing the archive data.
52 Every call to the write callback function, except possibly the last one, will
53 use this value for the length.
54 The default is to use a block size of 10240 bytes.
55 Note that a block size of zero will suppress internal blocking
56 and cause writes to be sent directly to the write callback as they occur.
57 .It Fn archive_write_get_bytes_per_block
58 Retrieve the block size to be used for writing.
59 A value of -1 here indicates that the library should use default values.
60 A value of zero indicates that internal blocking is suppressed.
61 .It Fn archive_write_set_bytes_in_last_block
62 Sets the block size used for writing the last block.
63 If this value is zero, the last block will be padded to the same size
65 Otherwise, the final block will be padded to a multiple of this size.
66 In particular, setting it to 1 will cause the final block to not be padded.
67 For compressed output, any padding generated by this option
68 is applied only after the compression.
69 The uncompressed data is always unpadded.
70 The default is to pad the last block to the full block size (note that
71 .Fn archive_write_open_filename
72 will set this based on the file type).
75 functions, this function can be called after the archive is opened.
76 .It Fn archive_write_get_bytes_in_last_block
77 Retrieve the currently-set value for last block size.
78 A value of -1 here indicates that the library should use default values.
82 .Fn archive_write_set_bytes_per_block
84 .Fn archive_write_set_bytes_in_last_block
90 .Fn archive_write_get_bytes_per_block
92 .Fn archive_write_get_bytes_in_last_block
93 return currently configured block size
96 indicates the default block size
102 Detailed error codes and textual descriptions are available from the
105 .Fn archive_error_string
111 .Xr archive_write_set_options 3 ,