tar
Streams TAR archives with optional gzip or zstd compression.
Types
| Type | Description |
|---|---|
Entry |
Metadata and streaming content for the current TAR entry. |
EntryWriter |
Content sink for one scoped TAR entry. |
Reader |
Destructive iterator over the entries in an open TAR archive. |
Writer |
Sequential writer for a new TAR archive. |
Functions
read[R] path func -> R
Opens an archive and calls func with a Reader.
Compression is detected from gzip or zstd magic bytes.
Parameters
| Name | Type | Description |
|---|---|---|
path |
(Str | fs.Path) |
Archive path. |
func |
((Reader) -> R) |
Reader scope, called with a Reader. |
Example
write[R] path func … -> R
Creates an archive and calls func with a Writer.
Parameters
| Name | Type | Description |
|---|---|---|
path |
(Str | fs.Path) |
Archive path. |
:compression? |
(:NONE: | :GZIP: | :ZSTD:) |
Compression. |
func |
((Writer) -> R) |
Writer scope, called with a Writer. |
:compression
When omitted, .gz and .tgz select gzip, .zst and .tzst select
zstd, and other extensions select no compression. Extension matching is
case-insensitive. An explicit compression overrides the path.