summaryrefslogtreecommitdiff
path: root/archivers/libarchive/files/doc/wiki/ManPageArchiveWriteBlocksize3.wiki
blob: 7975a5a3e162ce5c78ab42653dfaf59672ba43cc (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
ARCHIVE_WRITE_BLOCKSIZE(3) manual page 
== NAME == 
'''archive_write_get_bytes_per_block''', 
'''archive_write_set_bytes_per_block''', 
'''archive_write_get_bytes_in_last_block''', 
'''archive_write_set_bytes_in_last_block''' 
- functions for creating archives 
== LIBRARY == 
Streaming Archive Library (libarchive, -larchive) 
== SYNOPSIS == 
'''<nowiki>#include <archive.h></nowiki>''' 
<br> 
''int'' 
<br> 
'''archive_write_get_bytes_per_block'''(''struct archive *''); 
<br> 
''int'' 
<br> 
'''archive_write_set_bytes_per_block'''(''struct archive *'', ''int bytes_per_block''); 
<br> 
''int'' 
<br> 
'''archive_write_get_bytes_in_last_block'''(''struct archive *''); 
<br> 
''int'' 
<br> 
'''archive_write_set_bytes_in_last_block'''(''struct archive *'', ''int''); 
== DESCRIPTION == 
<dl> 
<dt>'''archive_write_set_bytes_per_block'''()</dt><dd> 
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. 
</dd><dt>'''archive_write_get_bytes_per_block'''()</dt><dd> 
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. 
</dd><dt>'''archive_write_set_bytes_in_last_block'''()</dt><dd> 
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 
'''archive_write_open_filename'''() 
will set this based on the file type). 
Unlike the other 
"set" 
functions, this function can be called after the archive is opened. 
</dd><dt>'''archive_write_get_bytes_in_last_block'''()</dt><dd> 
Retrieve the currently-set value for last block size. 
A value of -1 here indicates that the library should use default values. 
</dd></dl> 
== RETURN VALUES == 
'''archive_write_set_bytes_per_block'''() 
and 
'''archive_write_set_bytes_in_last_block'''() 
return 
'''ARCHIVE_OK''' 
on success, or 
'''ARCHIVE_FATAL'''. 

'''archive_write_get_bytes_per_block'''() 
and 
'''archive_write_get_bytes_in_last_block'''() 
return currently configured block size 
Po 
```text
-1 
```
indicates the default block size 
Pc, 
or 
'''ARCHIVE_FATAL'''. 
== ERRORS == 
Detailed error codes and textual descriptions are available from the 
'''archive_errno'''() 
and 
'''archive_error_string'''() 
functions. 
== SEE ALSO == 
[[ManPageBsdtar1]], 
[[ManPageLibarchive3]], 
[[ManPageArchiveWriteSetOptions3]], 
[[ManPageCpio5]], 
[[ManPageMtree5]], 
[[ManPageTar5]]