diff options
Diffstat (limited to 'Utilities/cmlibarchive/libarchive/archive_write_disk.3')
-rw-r--r-- | Utilities/cmlibarchive/libarchive/archive_write_disk.3 | 52 |
1 files changed, 39 insertions, 13 deletions
diff --git a/Utilities/cmlibarchive/libarchive/archive_write_disk.3 b/Utilities/cmlibarchive/libarchive/archive_write_disk.3 index 5ed4a50..ffadb04 100644 --- a/Utilities/cmlibarchive/libarchive/archive_write_disk.3 +++ b/Utilities/cmlibarchive/libarchive/archive_write_disk.3 @@ -25,7 +25,7 @@ .\" $FreeBSD: src/lib/libarchive/archive_write_disk.3,v 1.4 2008/09/04 05:22:00 kientzle Exp $ .\" .Dd August 5, 2008 -.Dt archive_write_disk 3 +.Dt ARCHIVE_WRITE_DISK 3 .Os .Sh NAME .Nm archive_write_disk_new , @@ -36,9 +36,11 @@ .Nm archive_write_disk_set_user_lookup , .Nm archive_write_header , .Nm archive_write_data , +.Nm archive_write_data_block , .Nm archive_write_finish_entry , .Nm archive_write_close , .Nm archive_write_finish +.Nm archive_write_free .Nd functions for creating objects on disk .Sh SYNOPSIS .In archive.h @@ -68,12 +70,16 @@ .Fn archive_write_header "struct archive *" "struct archive_entry *" .Ft ssize_t .Fn archive_write_data "struct archive *" "const void *" "size_t" +.Ft ssize_t +.Fn archive_write_data_block "struct archive *" "const void *" "size_t size" "int64_t offset" .Ft int .Fn archive_write_finish_entry "struct archive *" .Ft int .Fn archive_write_close "struct archive *" .Ft int .Fn archive_write_finish "struct archive *" +.Ft int +.Fn archive_write_free "struct archive *" .Sh DESCRIPTION These functions provide a complete API for creating objects on disk from @@ -221,6 +227,20 @@ objects. .It Fn archive_write_data Write data corresponding to the header just written. Returns number of bytes written or -1 on error. +.It Fn archive_write_data_block +Write data corresponding to the header just written. +This is like +.Fn 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 +.Tn archive_write +handles, only for +.Tn archive_write_disk +handles.) .It Fn archive_write_finish_entry Close out the entry just written. Ordinarily, clients never need to call this, as it @@ -229,6 +249,9 @@ is called automatically by and .Fn archive_write_close as needed. +However, some file attributes are written to disk only +after the file is closed, so this can be necessary +if you need to work with the file on disk right away. .It Fn archive_write_close Set any attributes that could not be set during the initial restore. For example, directory timestamps are not restored initially because @@ -240,6 +263,9 @@ The library maintains a list of all such deferred attributes and sets them when this function is invoked. .It Fn archive_write_finish +This is a deprecated synonym for +.Fn archive_write_free . +.It Fn archive_write_free Invokes .Fn archive_write_close if it was not invoked manually, then releases all resources. @@ -263,12 +289,6 @@ for operations that might succeed if retried, for unusual conditions that do not prevent further operations, and .Cm ARCHIVE_FATAL for serious errors that make remaining operations impossible. -The -.Fn archive_errno -and -.Fn archive_error_string -functions can be used to retrieve an appropriate error code and a -textual error message. .Pp .Fn archive_write_disk_new returns a pointer to a newly-allocated @@ -276,12 +296,18 @@ returns a pointer to a newly-allocated object. .Pp .Fn archive_write_data -returns a count of the number of bytes actually written. -On error, -1 is returned and the +returns a count of the number of bytes actually written, +or +.Li -1 +on error. +.\" +.Sh ERRORS +Detailed error codes and textual descriptions are available from the .Fn archive_errno and .Fn archive_error_string -functions will return appropriate values. +functions. +.\" .Sh SEE ALSO .Xr archive_read 3 , .Xr archive_write 3 , @@ -339,7 +365,7 @@ In particular, the directory .Pa aa is created as well as the final object .Pa bb . -In theory, this can be exploited to create an entire directory heirarchy +In theory, this can be exploited to create an entire directory hierarchy with a single request. Of course, this does not work if the .Cm ARCHIVE_EXTRACT_NODOTDOT @@ -371,5 +397,5 @@ compact implementation when appropriate. .Pp There should be a corresponding .Nm archive_read_disk -interface that walks a directory heirarchy and returns archive -entry objects.
\ No newline at end of file +interface that walks a directory hierarchy and returns archive +entry objects. |