def append.synced
import mylsm-lsm-store@0.6.0.1/src/ByteWalIo.bend as ByteWalIoimport 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)