Blob Blame History Raw
.TH ARCHIVE_WRITE_BLOCKSIZE 3 "February 2, 2012" ""
.SH NAME
.ad l
\fB\%archive_write_get_bytes_per_block\fP,
\fB\%archive_write_set_bytes_per_block\fP,
\fB\%archive_write_get_bytes_in_last_block\fP,
\fB\%archive_write_set_bytes_in_last_block\fP
\- functions for creating archives
.SH LIBRARY
.ad l
Streaming Archive Library (libarchive, -larchive)
.SH SYNOPSIS
.ad l
\fB#include <archive.h>\fP
.br
\fIint\fP
.br
\fB\%archive_write_get_bytes_per_block\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_write_set_bytes_per_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\ bytes_per_block\fP);
.br
\fIint\fP
.br
\fB\%archive_write_get_bytes_in_last_block\fP(\fI\%struct\ archive\ *\fP);
.br
\fIint\fP
.br
\fB\%archive_write_set_bytes_in_last_block\fP(\fI\%struct\ archive\ *\fP, \fI\%int\fP);
.SH DESCRIPTION
.ad l
.RS 5
.TP
\fB\%archive_write_set_bytes_per_block\fP()
Sets the block size used for writing the archive data.
Every call to the write callback function, except possibly the last one, will
use this value for the length.
The default is to use a block size of 10240 bytes.
Note that a block size of zero will suppress internal blocking
and cause writes to be sent directly to the write callback as they occur.
.TP
\fB\%archive_write_get_bytes_per_block\fP()
Retrieve the block size to be used for writing.
A value of -1 here indicates that the library should use default values.
A value of zero indicates that internal blocking is suppressed.
.TP
\fB\%archive_write_set_bytes_in_last_block\fP()
Sets the block size used for writing the last block.
If this value is zero, the last block will be padded to the same size
as the other blocks.
Otherwise, the final block will be padded to a multiple of this size.
In particular, setting it to 1 will cause the final block to not be padded.
For compressed output, any padding generated by this option
is applied only after the compression.
The uncompressed data is always unpadded.
The default is to pad the last block to the full block size (note that
\fB\%archive_write_open_filename\fP()
will set this based on the file type).
Unlike the other
``set''
functions, this function can be called after the archive is opened.
.TP
\fB\%archive_write_get_bytes_in_last_block\fP()
Retrieve the currently-set value for last block size.
A value of -1 here indicates that the library should use default values.
.RE
.SH RETURN VALUES
.ad l
\fB\%archive_write_set_bytes_per_block\fP()
and
\fB\%archive_write_set_bytes_in_last_block\fP()
return
\fBARCHIVE_OK\fP
on success, or
\fBARCHIVE_FATAL\fP.
.PP
\fB\%archive_write_get_bytes_per_block\fP()
and
\fB\%archive_write_get_bytes_in_last_block\fP()
return currently configured block size
Po
.RS 4
-1
.RE
indicates the default block size
Pc,
or
\fBARCHIVE_FATAL\fP.
.SH ERRORS
.ad l
Detailed error codes and textual descriptions are available from the
\fB\%archive_errno\fP()
and
\fB\%archive_error_string\fP()
functions.
.SH SEE ALSO
.ad l
\fBtar\fP(1),
\fBlibarchive\fP(3),
\fBarchive_write_set_options\fP(3),
\fBcpio\fP(5),
\fBmtree\fP(5),
\fBtar\fP(5)