diff options
author | kientzle <kientzle@FreeBSD.org> | 2005-01-25 06:07:28 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2005-01-25 06:07:28 +0000 |
commit | 973eae31d40e350837650e2c6e3eb0a128bc17bb (patch) | |
tree | b51c36aedc9be9adee4b56bd2a57cbb8ef65ffc0 /lib/libarchive/archive_read.3 | |
parent | a8e3a91bb37be12a91189861b526f6a5dfb53762 (diff) | |
download | FreeBSD-src-973eae31d40e350837650e2c6e3eb0a128bc17bb.zip FreeBSD-src-973eae31d40e350837650e2c6e3eb0a128bc17bb.tar.gz |
Basic support for ZIP archives.
Only supports "deflate" and "none" compression for now.
Also, add a few clarifications to the archive_read.3 manpage as
requested by William Dean DeVries.
Diffstat (limited to 'lib/libarchive/archive_read.3')
-rw-r--r-- | lib/libarchive/archive_read.3 | 36 |
1 files changed, 31 insertions, 5 deletions
diff --git a/lib/libarchive/archive_read.3 b/lib/libarchive/archive_read.3 index bed9c54..5d5948e3 100644 --- a/lib/libarchive/archive_read.3 +++ b/lib/libarchive/archive_read.3 @@ -39,6 +39,7 @@ .Nm archive_read_support_format_cpio , .Nm archive_read_support_format_iso9660 , .Nm archive_read_support_format_tar , +.Nm archive_read_support_format_zip , .Nm archive_read_open , .Nm archive_read_open_fd , .Nm archive_read_open_file , @@ -78,6 +79,8 @@ .Ft int .Fn archive_read_support_format_tar "struct archive *" .Ft int +.Fn archive_read_support_format_zip "struct archive *" +.Ft int .Fn archive_read_open "struct archive *" "void *client_data" "archive_open_archive_callback *" "archive_read_archive_callback *" "archive_close_archive_callback *" .Ft int .Fn archive_read_open_fd "struct archive *" "int fd" "size_t block_size" @@ -122,7 +125,7 @@ Sets the block size used for reading the archive data. This controls the size that will be used when invoking the read callback function. The default is 20 records or 10240 bytes for tar formats. -.It Fn archive_read_support_comression_all , Fn archive_read_support_compression_bzip2 , Fn archive_read_support_compression_compress , Fn archive_read_support_compression_gzip , Fn archive_read_support_compression_none +.It Fn archive_read_support_compression_all , Fn archive_read_support_compression_bzip2 , Fn archive_read_support_compression_compress , Fn archive_read_support_compression_gzip , Fn archive_read_support_compression_none Enables auto-detection code and decompression support for the specified compression. Note that @@ -131,7 +134,7 @@ is always enabled by default. For convenience, .Fn archive_read_support_compression_all enables all available decompression code. -.It Fn archive_read_support_format_all , Fn archive_read_support_format_cpio , Fn archive_read_support_format_iso9660 , Fn archive_read_support_format_tar +.It Fn archive_read_support_format_all , Fn archive_read_support_format_cpio , Fn archive_read_support_format_iso9660 , Fn archive_read_support_format_tar, Fn archive_read_support_format_zip Enables support---including auto-detection code---for the specified archive format. For example, @@ -233,7 +236,9 @@ By default, they are ignored. Note that restoring of atime is not currently supported. .It Cm ARCHIVE_EXTRACT_NO_OVERWRITE Existing files on disk will not be overwritten. -By default, existing files are unlinked before the new entry is written. +By default, existing regular files are truncated and overwritten; +existing directories will have their permissions updated; +other pre-existing objects are unlinked and recreated from scratch. .It Cm ARCHIVE_EXTRACT_UNLINK Existing files on disk will be unlinked and recreated from scratch. By default, existing files are truncated and rewritten, but @@ -401,9 +406,9 @@ myclose(struct archive *a, void *client_data) Most functions return zero on success, non-zero on error. The possible return codes include: .Cm ARCHIVE_OK -(the operation succeeded) +(the operation succeeded), .Cm ARCHIVE_WARN -(the operation succeeded but a non-critical error was encountered) +(the operation succeeded but a non-critical error was encountered), .Cm ARCHIVE_EOF (end-of-archive was encountered), .Cm ARCHIVE_RETRY @@ -467,3 +472,24 @@ The library was written by .An Tim Kientzle Aq kientzle@acm.org . .Sh BUGS +Directories are actually extracted in two distinct phases. +Directories are created during +.Fn archive_read_extract , +but final permissions are not set until +.Fn archive_read_close . +This separation is necessary to correctly handle borderline +cases such as a non-writable directory containing +files, but can cause unexpected results. +In particular, directory permissions are not fully +restored until the archive is closed. +If you use +.Xr chdir 2 +to change the current directory between calls to +.Fn archive_read_extract +or before calling +.Fn archive_read_close , +you may confuse the permission-setting logic with +the result that directory permissions are restored +incorrectly. + + |