def export
mylsm-lsm-store@0.6.0.1 · src/transfer/BackupOwnerCursorIo.bend:365
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/Fs.bend as Fs
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
365
366def export(
367 +destination: String,
368 source: OwnerSource,
369 entry_count: Nat,
370 fuel: Nat
371) -> IO(Result<&1, &1, BackupIo.Error, Unit>):
372 +temporary = destination ++ ".backup-060.tmp"
373 do IO<Result<&1, &1, BackupIo.Error, Unit>>:
374 initial : BackupCursor.Step <- IO.pure(BackupCursor.Step,
375 BackupCursor.start.owner(entry_count))
376 exists : Result<&1, &1, U32 & String, Bool> <-
377 Fs.exists(BackupCursorIo.path.clone(destination))
378 destination.checked(destination, temporary, source, initial, fuel, exists)