def step.type

bend-kit-tar@0.3.0.0 · tar.bend:424

import bend-kit-tar@0.3.0.0/tar.bend as Tar
import Base
import bend-kit-bytes@0.3.3.0/bytes.bend as Bytes

424# '0'/NUL are files, '5' directories, 'x' local PAX and 'g' ignored global PAX.
425# Links, devices, FIFOs, GNU extensions and all other types fail.
426def step.type(+t: U32, c: Bytes.Cursor, +size: U32, pax: Pax, acc: List<&1, Entry>) -> Bytes.Cursor & St:
427  match t:
428    case 0:
429      entry.file(c, size, pax, acc)
430    case 48:
431      entry.file(c, size, pax, acc)
432    case 53:
433      entry.dir(c, pax, acc)
434    case 120:
435      step.pax(acc, pr.parse(c, pax))
436    case 103:
437      (c, SHead{pax, acc})
438    case _:
439      (c, SFail{})

Uses (15)

Used by (1)