archive_write_data man page

archive_write_data — functions for creating archives


Streaming Archive Library (libarchive, -larchive)


#include <archive.h>

archive_write_data(struct archive *, const void *, size_t);


Write data corresponding to the header just written.

Return Values

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


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


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

See Also

tar(1), libarchive(3), archive_write_finish_entry(3), archive_write_set_options(3), cpio(5), mtree(5), tar(5)

Referenced By

archive_read_extract(3), archive_write(3), archive_write_finish_entry(3).

Explore man page connections for archive_write_data(3).

February 2, 2012