9d99a7d5870ffc999814a95b0c48b5a2e8259777
[platform/upstream/libarchive.git] / doc / man / archive_write_blocksize.3
1 .TH ARCHIVE_WRITE_BLOCKSIZE 3 "February 2, 2012" ""
2 .SH NAME
3 .ad l
4 \fB\%archive_write_get_bytes_per_block\fP,
5 \fB\%archive_write_set_bytes_per_block\fP,
6 \fB\%archive_write_get_bytes_in_last_block\fP,
7 \fB\%archive_write_set_bytes_in_last_block\fP
8 \- functions for creating archives
9 .SH LIBRARY
10 .ad l
11 Streaming Archive Library (libarchive, -larchive)
12 .SH SYNOPSIS
13 .ad l
14 \fB#include <archive.h>\fP
15 .br
16 \fIint\fP
17 .br
18 \fB\%archive_write_get_bytes_per_block\fP(\fI\%struct\ archive\ *\fP);
19 .br
20 \fIint\fP
21 .br
22 \fB\%archive_write_set_bytes_per_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ bytes_per_block\fP);
23 .br
24 \fIint\fP
25 .br
26 \fB\%archive_write_get_bytes_in_last_block\fP(\fI\%struct\ archive\ *\fP);
27 .br
28 \fIint\fP
29 .br
30 \fB\%archive_write_set_bytes_in_last_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
31 .SH DESCRIPTION
32 .ad l
33 .RS 5
34 .TP
35 \fB\%archive_write_set_bytes_per_block\fP()
36 Sets the block size used for writing the archive data.
37 Every call to the write callback function, except possibly the last one, will
38 use this value for the length.
39 The default is to use a block size of 10240 bytes.
40 Note that a block size of zero will suppress internal blocking
41 and cause writes to be sent directly to the write callback as they occur.
42 .TP
43 \fB\%archive_write_get_bytes_per_block\fP()
44 Retrieve the block size to be used for writing.
45 A value of -1 here indicates that the library should use default values.
46 A value of zero indicates that internal blocking is suppressed.
47 .TP
48 \fB\%archive_write_set_bytes_in_last_block\fP()
49 Sets the block size used for writing the last block.
50 If this value is zero, the last block will be padded to the same size
51 as the other blocks.
52 Otherwise, the final block will be padded to a multiple of this size.
53 In particular, setting it to 1 will cause the final block to not be padded.
54 For compressed output, any padding generated by this option
55 is applied only after the compression.
56 The uncompressed data is always unpadded.
57 The default is to pad the last block to the full block size (note that
58 \fB\%archive_write_open_filename\fP()
59 will set this based on the file type).
60 Unlike the other
61 ``set''
62 functions, this function can be called after the archive is opened.
63 .TP
64 \fB\%archive_write_get_bytes_in_last_block\fP()
65 Retrieve the currently-set value for last block size.
66 A value of -1 here indicates that the library should use default values.
67 .RE
68 .SH RETURN VALUES
69 .ad l
70 \fB\%archive_write_set_bytes_per_block\fP()
71 and
72 \fB\%archive_write_set_bytes_in_last_block\fP()
73 return
74 \fBARCHIVE_OK\fP
75 on success, or
76 \fBARCHIVE_FATAL\fP.
77 .PP
78 \fB\%archive_write_get_bytes_per_block\fP()
79 and
80 \fB\%archive_write_get_bytes_in_last_block\fP()
81 return currently configured block size
82 Po
83 .RS 4
84 -1
85 .RE
86 indicates the default block size
87 Pc,
88 or
89 \fBARCHIVE_FATAL\fP.
90 .SH ERRORS
91 .ad l
92 Detailed error codes and textual descriptions are available from the
93 \fB\%archive_errno\fP()
94 and
95 \fB\%archive_error_string\fP()
96 functions.
97 .SH SEE ALSO
98 .ad l
99 \fBtar\fP(1),
100 \fBlibarchive\fP(3),
101 \fBarchive_write_set_options\fP(3),
102 \fBcpio\fP(5),
103 \fBmtree\fP(5),
104 \fBtar\fP(5)