azjezz/tarry

维护者

详细信息

github.com/azjezz/tarry

源代码

问题

安装: 7

依赖: 0

建议者: 0

安全: 0

星标: 1

关注者: 3

分支: 0

开放问题: 0

语言:Hack

0.2.0 2021-07-06 20:03 UTC

This package is auto-updated.

Last update: 2024-09-07 03:07:57 UTC


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 了解更多信息。