Blame libarchive/archive_write_blocksize.3

Packit Service 1d0348
.\" Copyright (c) 2003-2011 Tim Kientzle
Packit Service 1d0348
.\" All rights reserved.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" Redistribution and use in source and binary forms, with or without
Packit Service 1d0348
.\" modification, are permitted provided that the following conditions
Packit Service 1d0348
.\" are met:
Packit Service 1d0348
.\" 1. Redistributions of source code must retain the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer.
Packit Service 1d0348
.\" 2. Redistributions in binary form must reproduce the above copyright
Packit Service 1d0348
.\"    notice, this list of conditions and the following disclaimer in the
Packit Service 1d0348
.\"    documentation and/or other materials provided with the distribution.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR AND CONTRIBUTORS ``AS IS'' AND
Packit Service 1d0348
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
Packit Service 1d0348
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
Packit Service 1d0348
.\" ARE DISCLAIMED.  IN NO EVENT SHALL THE AUTHOR OR CONTRIBUTORS BE LIABLE
Packit Service 1d0348
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
Packit Service 1d0348
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
Packit Service 1d0348
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
Packit Service 1d0348
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
Packit Service 1d0348
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
Packit Service 1d0348
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
Packit Service 1d0348
.\" SUCH DAMAGE.
Packit Service 1d0348
.\"
Packit Service 1d0348
.\" $FreeBSD$
Packit Service 1d0348
.\"
Packit Service 1d0348
.Dd February 2, 2012
Packit Service 1d0348
.Dt ARCHIVE_WRITE_BLOCKSIZE 3
Packit Service 1d0348
.Os
Packit Service 1d0348
.Sh NAME
Packit Service 1d0348
.Nm archive_write_get_bytes_per_block ,
Packit Service 1d0348
.Nm archive_write_set_bytes_per_block ,
Packit Service 1d0348
.Nm archive_write_get_bytes_in_last_block ,
Packit Service 1d0348
.Nm archive_write_set_bytes_in_last_block
Packit Service 1d0348
.Nd functions for creating archives
Packit Service 1d0348
.Sh LIBRARY
Packit Service 1d0348
Streaming Archive Library (libarchive, -larchive)
Packit Service 1d0348
.Sh SYNOPSIS
Packit Service 1d0348
.In archive.h
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fn archive_write_get_bytes_per_block "struct archive *"
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fn archive_write_set_bytes_per_block "struct archive *" "int bytes_per_block"
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fn archive_write_get_bytes_in_last_block "struct archive *"
Packit Service 1d0348
.Ft int
Packit Service 1d0348
.Fn archive_write_set_bytes_in_last_block "struct archive *" "int"
Packit Service 1d0348
.Sh DESCRIPTION
Packit Service 1d0348
.Bl -tag -width indent
Packit Service 1d0348
.It Fn archive_write_set_bytes_per_block
Packit Service 1d0348
Sets the block size used for writing the archive data.
Packit Service 1d0348
Every call to the write callback function, except possibly the last one, will
Packit Service 1d0348
use this value for the length.
Packit Service 1d0348
The default is to use a block size of 10240 bytes.
Packit Service 1d0348
Note that a block size of zero will suppress internal blocking
Packit Service 1d0348
and cause writes to be sent directly to the write callback as they occur.
Packit Service 1d0348
.It Fn archive_write_get_bytes_per_block
Packit Service 1d0348
Retrieve the block size to be used for writing.
Packit Service 1d0348
A value of -1 here indicates that the library should use default values.
Packit Service 1d0348
A value of zero indicates that internal blocking is suppressed.
Packit Service 1d0348
.It Fn archive_write_set_bytes_in_last_block
Packit Service 1d0348
Sets the block size used for writing the last block.
Packit Service 1d0348
If this value is zero, the last block will be padded to the same size
Packit Service 1d0348
as the other blocks.
Packit Service 1d0348
Otherwise, the final block will be padded to a multiple of this size.
Packit Service 1d0348
In particular, setting it to 1 will cause the final block to not be padded.
Packit Service 1d0348
For compressed output, any padding generated by this option
Packit Service 1d0348
is applied only after the compression.
Packit Service 1d0348
The uncompressed data is always unpadded.
Packit Service 1d0348
The default is to pad the last block to the full block size (note that
Packit Service 1d0348
.Fn archive_write_open_filename
Packit Service 1d0348
will set this based on the file type).
Packit Service 1d0348
Unlike the other
Packit Service 1d0348
.Dq set
Packit Service 1d0348
functions, this function can be called after the archive is opened.
Packit Service 1d0348
.It Fn archive_write_get_bytes_in_last_block
Packit Service 1d0348
Retrieve the currently-set value for last block size.
Packit Service 1d0348
A value of -1 here indicates that the library should use default values.
Packit Service 1d0348
.El
Packit Service 1d0348
.\" .Sh EXAMPLE
Packit Service 1d0348
.Sh RETURN VALUES
Packit Service 1d0348
.Fn archive_write_set_bytes_per_block
Packit Service 1d0348
and
Packit Service 1d0348
.Fn archive_write_set_bytes_in_last_block
Packit Service 1d0348
return
Packit Service 1d0348
.Cm ARCHIVE_OK
Packit Service 1d0348
on success, or
Packit Service 1d0348
.Cm ARCHIVE_FATAL .
Packit Service 1d0348
.Pp
Packit Service 1d0348
.Fn archive_write_get_bytes_per_block
Packit Service 1d0348
and
Packit Service 1d0348
.Fn archive_write_get_bytes_in_last_block
Packit Service 1d0348
return currently configured block size
Packit Service 1d0348
.Po
Packit Service 1d0348
.Li -1
Packit Service 1d0348
indicates the default block size
Packit Service 1d0348
.Pc ,
Packit Service 1d0348
or
Packit Service 1d0348
.Cm ARCHIVE_FATAL .
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh ERRORS
Packit Service 1d0348
Detailed error codes and textual descriptions are available from the
Packit Service 1d0348
.Fn archive_errno
Packit Service 1d0348
and
Packit Service 1d0348
.Fn archive_error_string
Packit Service 1d0348
functions.
Packit Service 1d0348
.\"
Packit Service 1d0348
.Sh SEE ALSO
Packit Service 1d0348
.Xr tar 1 ,
Packit Service 1d0348
.Xr libarchive 3 ,
Packit Service 1d0348
.Xr archive_write_set_options 3 ,
Packit Service 1d0348
.Xr cpio 5 ,
Packit Service 1d0348
.Xr mtree 5 ,
Packit Service 1d0348
.Xr tar 5