Blame doc/man/archive_write_blocksize.3

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