def append.synced

mylsm-lsm-store@0.6.0.1 · src/ByteWalIo.bend:510

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

510def append.synced(
511  result: Result<&1, &1, U32 & String, Unit>,
512  file: File,
513  +path: String
514) -> IO(Result<&1, &1, U32 & String, Unit>):
515  match result:
516    case Fail{failure}:
517      do IO<Result<&1, &1, U32 & String, Unit>>:
518        _closed : Unit <- File.close(file)
519        return Fail{failure}
520    case Done{Unit{}}:
521      do IO<Result<&1, &1, U32 & String, Unit>>:
522        _closed : Unit <- File.close(file)
523        Fs.fsync(path)

Uses (11)

Used by (1)