azjezz/tarry

Maintainers

Details

github.com/azjezz/tarry

Source

Issues

Installs: 7

Dependents: 0

Suggesters: 0

Security: 0

Stars: 1

Watchers: 3

Forks: 0

Open Issues: 0

Language:Hack

0.2.0 2021-07-06 20:03 UTC

This package is auto-updated.

Last update: 2024-11-07 03:45:15 UTC


README

Tarry is a small utility for building TAR archives.

Installation

This package is available via composer:

composer require azjezz/tarry

Features

Supported

  • ability to create a TAR archive.
  • GZIP compression
  • BZIP compression
  • adding files
  • modifying file permissions, user id, group id, and mtime.

TODO

  • add support for long filenames.
  • extracting existing archives.
  • modifying existing archives
  • more?

Usage

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');
}

License

The MIT License (MIT). Please see LICENSE for more information.