azjezz / tarry
0.2.0
2021-07-06 20:03 UTC
Requires
- hhvm: ^4.113.0
Requires (Dev)
- hhvm/hhast: ^4.113.0
- hhvm/hhvm-autoload: ^3.2.0
README
Tarry 是一个用于构建 TAR 归档的小型工具。
安装
此包可通过 composer
获取
composer require azjezz/tarry
功能
支持
- 创建 TAR 归档的能力。
- GZIP 压缩
- BZIP 压缩
- 添加文件
- 修改文件权限、用户 ID、组 ID 和 mtime。
待办事项
- 添加对长文件名的支持。
- 提取现有归档。
- 修改现有归档
- 还有其他吗?
用法
use namespace Tarry; use namespace HH\Lib\File; async function main(): Awaitable<void> { $archive = Tarry\ArchiveBuilder::create() ->withCompressionAlgorithm(CompressionAlgorithm::GZIP) ->withCompressionLevel(9) ->withNode(shape( 'filename' => 'hello-world.txt', 'content' => 'Hello, World!', )) ->build(); await $archive->saveToFile('hello-world.tar.gz'); }
许可证
MIT 许可证 (MIT)。请参阅 LICENSE
了解更多信息。