1ARCHIVE_WRITE_BLOCKSI... BSD Library Functions Manual ARCHIVE_WRITE_BLOCKSI... 2 3NAME 4 archive_write_get_bytes_per_block, archive_write_set_bytes_per_block, 5 archive_write_get_bytes_in_last_block, 6 archive_write_set_bytes_in_last_block — functions for creating archives 7 8LIBRARY 9 Streaming Archive Library (libarchive, -larchive) 10 11SYNOPSIS 12 #include <archive.h> 13 14 int 15 archive_write_get_bytes_per_block(struct archive *); 16 17 int 18 archive_write_set_bytes_per_block(struct archive *, int bytes_per_block); 19 20 int 21 archive_write_get_bytes_in_last_block(struct archive *); 22 23 int 24 archive_write_set_bytes_in_last_block(struct archive *, int); 25 26DESCRIPTION 27 archive_write_set_bytes_per_block() 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 archive_write_get_bytes_per_block() 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 archive_write_set_bytes_in_last_block() 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 archive_write_open_filename() 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 archive_write_get_bytes_in_last_block() 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 57RETURN VALUES 58 archive_write_set_bytes_per_block() and 59 archive_write_set_bytes_in_last_block() return ARCHIVE_OK on success, or 60 ARCHIVE_FATAL. 61 62 archive_write_get_bytes_per_block() and 63 archive_write_get_bytes_in_last_block() return currently configured block 64 size (-1 indicates the default block size), or ARCHIVE_FATAL. 65 66ERRORS 67 Detailed error codes and textual descriptions are available from the 68 archive_errno() and archive_error_string() functions. 69 70SEE ALSO 71 tar(1), archive_write_set_options(3), libarchive(3), cpio(5), mtree(5), 72 tar(5) 73 74BSD February 2, 2012 BSD 75