Skip to content

Entry

Metadata and streaming content for the current TAR entry.

The handle remains valid only until its parent Reader advances or leaves scope. Iterating an entry yields arbitrary-sized Bin chunks until the content is exhausted.

A function that accepts an Io, such as compress.decompress, can read the content while the handle is valid.

Example

for chunk = entry
  output.put $chunk

Inherits from: Iter[Bin], io.Io

Fields

device_major @ (Int | nil) [get]

Device major number, or nil when absent.

device_minor @ (Int | nil) [get]

Device minor number, or nil when absent.

gid @ Int [get]

Numeric group ID.

group_name @ (Str | nil) [get]

Group name, or nil when absent.

link_name @ (fs.unix.Path | nil) [get]

Link target as an fs.unix.Path, or nil when absent.

mode @ Int [get]

Unix permission bits.

mtime @ time.DateTime [get]

Modification time as DateTime.

owner_name @ (Str | nil) [get]

Owner name, or nil when absent.

path @ fs.unix.Path [get]

Entry path as an fs.unix.Path.

readable @ Bool [get]

Whether the content can be read: whether the handle is still valid.

size @ Int [get]

Declared content size in bytes.

type @ EntryType [get]

Entry type.

uid @ Int [get]

Numeric owner ID.

Methods

(next)() -> Bin

Yields the next content chunk, ending iteration once the entry is exhausted.

read size -> Bin

Reads up to size bytes from the current content position.

Parameters

NameTypeDescription
size Int Maximum bytes to read.

Example

let prefix = entry.read 512