tar
Streams TAR archives with optional gzip or zstd compression.
Types
| Type | Description |
|---|---|
Reader |
Destructive archive entry iterator |
Entry |
Metadata and content for one entry |
Writer |
Sequential archive writer |
EntryWriter |
Scoped entry content sink |
Functions
read path func
Opens an archive and calls func with a Reader.
Compression is detected from gzip or zstd magic bytes.
Parameters:
| Name | Type | Description |
|---|---|---|
path |
Str|Path |
Archive path |
func |
callable | Reader scope |
Returns: the result of func.
write path :compression? func
Creates an archive and calls func with a Writer.
Parameters:
| Name | Type | Description |
|---|---|---|
path |
Str|Path |
Archive path |
compression |
Sym? |
:NONE:, :GZIP:, or :ZSTD: |
func |
callable | Writer scope |
When compression is 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.
Returns: the result of func.