def ent.read

ezx@1.11.0.0 · src/sha/dump.bend:69

import ezx@1.11.0.0/src/sha/dump.bend as Dump
import Base
import ezx@1.11.0.0/src/sha/nar.bend as Nar

69# a regular file's text read, or anything else as the listing gave it
70def ent.read(
71  file: Bool,
72  +kind: String,
73  +mode: String,
74  +name: String,
75  +at: String,
76  +target: String,
77  +path: String
78) -> IO(Nar.Ent):
79  match file:
80    case True{}:
81      do IO<Nar.Ent>:
82        body : String <- file.of(path)
83        return Nar.Ent{kind, Nar.owner.exec(mode), name, at, body}
84    case False{}:
85      ent.other(Bool.or(String.eq(kind, "d"), String.eq(kind, "l")), kind, name, at,
86        target, path)

Uses (11)

Used by (1)