Linux压缩库archive使用

这篇博客介绍了Linux中archive库的使用,包括如何选择压缩或解压格式,如bzip2、gzip等,并提供了如何读取压缩包及在解压时写入磁盘的详细步骤,涉及权限控制和时间戳恢复等高级特性。
摘要由CSDN通过智能技术生成

## 读取初始化

archive_read_new()

Allocates and initializes a struct archive object suitable for reading from an archive.

分配和初始化适合从存档中读取的struct归档对象。

选择压缩或解压格式

archive_read_support_format_all(struct archive *)

Enables support for all available formats except the “raw” format.

支持除“原始”格式之外的所有可用格式.

archive_read_support_compression_all(),

1.archive_read_support_compression_bzip2(),
2.archive_read_support_compression_compress(),
3.archive_read_support_compression_gzip(),
4.archive_read_support_compression_none()
Enables auto-detection code and decompression support for the specified compression. Note that ``none’’ is always enabled by default. For convenience,archive_read_support_compression_all() enables all available decompression code.

为指定的压缩启用自动检测代码和解压缩支持。请注意,默认情况下始终启用“无”。为方便起见,archive_read_su

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值