def read.opened

mylsm-lsm-store@0.6.0.1 · src/coordinator/OwnerGenerationIo.bend:99

import mylsm-lsm-store@0.6.0.1/src/coordinator/OwnerGenerationIo.bend as OwnerGenerationIo
import Base
import mylsm-lsm-store@0.6.0.1/src/Fs.bend as Fs

99def read.opened(
100  paths: String & String,
101  opened: Result<&1, &1, U32 & String, File>
102) -> IO(Result<&1, &1, Error, U32>):
103  match paths:
104    case (size_path, retained_path):
105      match opened:
106        case Fail{error}:
107          IO.pure(Result<&1, &1, Error, U32>, Fail{host(error)})
108        case Done{file}:
109          do IO<Result<&1, &1, Error, U32>>:
110            size : Result<&1, &1, U32 & String, Nat> <- Fs.file_size(size_path)
111            read.size(file, size)

Uses (14)

Used by (1)