1ARCHIVE_WRITE_DATA(3)    BSD Library Functions Manual    ARCHIVE_WRITE_DATA(3)
2

NAME

4     archive_write_data, archive_write_data_block — functions for creating ar‐
5     chives
6

LIBRARY

8     Streaming Archive Library (libarchive, -larchive)
9

SYNOPSIS

11     #include <archive.h>
12
13     la_ssize_t
14     archive_write_data(struct archive *, const void *, size_t);
15
16     la_ssize_t
17     archive_write_data_block(struct archive *, const void *, size_t size,
18         int64_t offset);
19

DESCRIPTION

21     archive_write_data()
22             Write data corresponding to the header just written.
23
24     archive_write_data_block()
25             Write data corresponding to the header just written.  This is
26             like archive_write_data() except that it performs a seek on the
27             file being written to the specified offset before writing the
28             data.  This is useful when restoring sparse files from archive
29             formats that support sparse files.  Returns number of bytes writ‐
30             ten or -1 on error.  (Note: This is currently not supported for
31             archive_write handles, only for archive_write_disk handles.
32

RETURN VALUES

34     This function returns the number of bytes actually written, or a negative
35     error code on error.
36

ERRORS

38     Detailed error codes and textual descriptions are available from the
39     archive_errno() and archive_error_string() functions.
40

BUGS

42     In libarchive 3.x, this function sometimes returns zero on success
43     instead of returning the number of bytes written.  Specifically, this
44     occurs when writing to an archive_write_disk handle.  Clients should
45     treat any value less than zero as an error and consider any non-negative
46     value as success.
47

SEE ALSO

49     tar(1), libarchive(3), archive_write_finish_entry(3),
50     archive_write_set_options(3), cpio(5), mtree(5), tar(5)
51
52BSD                            February 28, 2017                           BSD
Impressum