Imported Upstream version 3.3.1
[platform/upstream/libarchive.git] / doc / text / archive_write_blocksize.3.txt
1 ARCHIVE_WRITE_BLOCKSI... BSD Library Functions Manual ARCHIVE_WRITE_BLOCKSI...
2
3 1mNAME0m
4      1marchive_write_get_bytes_per_block22m, 1marchive_write_set_bytes_per_block22m,
5      1marchive_write_get_bytes_in_last_block22m,
6      1marchive_write_set_bytes_in_last_block 22m— functions for creating archives
7
8 1mLIBRARY0m
9      Streaming Archive Library (libarchive, -larchive)
10
11 1mSYNOPSIS0m
12      1m#include <archive.h>0m
13
14      4mint0m
15      1marchive_write_get_bytes_per_block22m(4mstruct24m 4marchive24m 4m*24m);
16
17      4mint0m
18      1marchive_write_set_bytes_per_block22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m 4mbytes_per_block24m);
19
20      4mint0m
21      1marchive_write_get_bytes_in_last_block22m(4mstruct24m 4marchive24m 4m*24m);
22
23      4mint0m
24      1marchive_write_set_bytes_in_last_block22m(4mstruct24m 4marchive24m 4m*24m, 4mint24m);
25
26 1mDESCRIPTION0m
27      1marchive_write_set_bytes_per_block22m()
28              Sets the block size used for writing the archive data.  Every
29              call to the write callback function, except possibly the last
30              one, will use this value for the length.  The default is to use a
31              block size of 10240 bytes.  Note that a block size of zero will
32              suppress internal blocking and cause writes to be sent directly
33              to the write callback as they occur.
34
35      1marchive_write_get_bytes_per_block22m()
36              Retrieve the block size to be used for writing.  A value of -1
37              here indicates that the library should use default values.  A
38              value of zero indicates that internal blocking is suppressed.
39
40      1marchive_write_set_bytes_in_last_block22m()
41              Sets the block size used for writing the last block.  If this
42              value is zero, the last block will be padded to the same size as
43              the other blocks.  Otherwise, the final block will be padded to a
44              multiple of this size.  In particular, setting it to 1 will cause
45              the final block to not be padded.  For compressed output, any
46              padding generated by this option is applied only after the com‐
47              pression.  The uncompressed data is always unpadded.  The default
48              is to pad the last block to the full block size (note that
49              1marchive_write_open_filename22m() will set this based on the file
50              type).  Unlike the other “set” functions, this function can be
51              called after the archive is opened.
52
53      1marchive_write_get_bytes_in_last_block22m()
54              Retrieve the currently-set value for last block size.  A value of
55              -1 here indicates that the library should use default values.
56
57 1mRETURN VALUES0m
58      1marchive_write_set_bytes_per_block22m() and
59      1marchive_write_set_bytes_in_last_block22m() return 1mARCHIVE_OK 22mon success, or
60      1mARCHIVE_FATAL22m.
61
62      1marchive_write_get_bytes_per_block22m() and
63      1marchive_write_get_bytes_in_last_block22m() return currently configured block
64      size (-1 indicates the default block size), or 1mARCHIVE_FATAL22m.
65
66 1mERRORS0m
67      Detailed error codes and textual descriptions are available from the
68      1marchive_errno22m() and 1marchive_error_string22m() functions.
69
70 1mSEE ALSO0m
71      tar(1), libarchive(3), archive_write_set_options(3), cpio(5), mtree(5),
72      tar(5)
73
74 BSD                            February 2, 2012                            BSD