logo
Free, unlimited AI code reviews that run on commit
git-lrc git-lrc GitHub Install Now We'd appreciate a star git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt git-lrc - Free, unlimited AI code reviews that run on commit | Product Hunt

archive_write_data, archive_write_data_block — functions for creating archives

Bugs

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.

Description

archive_write_data() Write data corresponding to the header just written. archive_write_data_block() Write data corresponding to the header just written. This is like archive_write_data() except that it performs a seek on the file being written to the specified offset before writing the data. This is useful when restoring sparse files from archive formats that support sparse files. Returns number of bytes written or -1 on error. (Note: This is currently not supported for archive_write handles, only for archive_write_disk handles.

Errors

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

Library

Streaming Archive Library (libarchive, -larchive)

Name

archive_write_data, archive_write_data_block — functions for creating archives

Return Values

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

See Also

tar(1), archive_write_finish_entry(3), archive_write_set_options(3), libarchive(3), cpio(5), mtree(5), tar(5) Debian February 28, 2017 ARCHIVE_WRITE_DATA(3)

Synopsis

#include<archive.h>la_ssize_tarchive_write_data(structarchive*, constvoid*, size_t); la_ssize_tarchive_write_data_block(structarchive*, constvoid*, size_tsize, int64_toffset);

See Also