def directory.created

mylsm-lsm-store@0.6.0.1 · src/transfer/BackupOwnerCursorIo.bend:322

import mylsm-lsm-store@0.6.0.1/src/transfer/BackupOwnerCursorIo.bend as BackupOwnerCursorIo
import Base
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursor.bend as BackupCursor
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupCursorIo.bend as BackupCursorIo
import mylsm-lsm-store@0.6.0.1/src/transfer/BackupIo.bend as BackupIo

322def directory.created(
323  +destination: String,
324  +temporary: String,
325  source: OwnerSource,
326  initial: BackupCursor.Step,
327  fuel: Nat,
328  created: Result<&1, &1, U32 & String, Unit>
329) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
330  match created:
331    case Fail{error}:
332      do IO<Result<&1, &1, BackupIo.Error, Unit>>:
333        _closed : Unit <- close.failed.source.no_file(source)
334        BackupCursorIo.initial.failed(initial, error.io(error))
335    case Done{Unit{}}:
336      do IO<Result<&1, &1, BackupIo.Error, Unit>>:
337        opened : Result<&1, &1, U32 & String, File> <-
338          File.open(BackupCursorIo.path.clone(temporary ++ "/BACKUP"), "w")
339        file.opened(destination, temporary, source, initial, fuel, opened)

Uses (19)

Used by (1)