是否可以使用 Rhodes 框架解压缩档案?支持哪些类型的存档?
1 回答
由于它基于 ruby,我认为您可以将 ruby 包装器用于libarchive或ZLib(放气算法的实现,gzip 格式)。如果您想使用纯 ruby 库,请尝试Zliby,它是 Zlib 的替代品。
libarchive 支持以下归档类型(来源http://code.google.com/p/libarchive/wiki/LibarchiveFormats)
过滤器支持
Libarchive 2.6 及更高版本在读取档案时支持多个过滤器。Libarchive 3.0 及更高版本在编写档案时支持多个过滤器。
gzip (read and write, uses zlib) bzip2 (read and write, uses bzlib) compress (read and write, uses an internal implementation) uudecode (read only) separate command-line compressors with fixed-signature auto-detection xz and lzma (read and write using liblzma) lzma (if you lack liblzma, you can get read-only lzma support through the
lzmadec 库;一旦 liblzma 稳定且广泛可用,这可能会被删除)从 libarchive 2.7 开始,如果库在构建时不可用,上述大部分内容将回退到使用命令行工具。请注意,命令行工具通常比直接使用库要慢。
支持的存档格式
tar (read and write, including GNU extensions) pax (read and write, including GNU and star extensions) cpio (read and write, including odc and newc variants) ISO9660 (read only, including Joliet and Rockridge extensions, with
一些限制;从 libarchive 2.9 开始的写入支持) Zip(只读,有一些限制,使用 zlib;从 libarchive 2.8 开始的写入支持) mtree(读写,使用 OpenSSL 库来创建和验证加密哈希) shar(只写) ar(读取和写入,包括 BSD 和 GNU/SysV 变体)空(只读;特别注意,没有其他格式将接受空文件)原始(只读,从 libarchive 2.8 开始) xar(只读,从 libarchive 2.8 开始)