def write_atomic_at.opened
mylsm-lsm-store@0.6.0.1 · src/ByteSstIo.bend:334
import mylsm-lsm-store@0.6.0.1/src/ByteSstIo.bend as ByteSstIo
import Base
import mylsm-lsm-store@0.6.0.1/src/ByteSstFile.bend as ByteSstFile
import mylsm-lsm-store@0.6.0.1/src/ByteMemTable.bend as ByteMemTable
334def write_atomic_at.opened(
335 +directory: String,
336 temporary_copies: String & String,
337 final_path: String,
338 entries: List<&1, ByteMemTable.Entry>
339) -> IO(Result<&1, &1, U32 & String, Unit>):
340 match temporary_copies:
341 case (temporary, retained_temporary):
342 do IO<Result<&1, &1, U32 & String, Unit>>:
343 opened : Result<&1, &1, U32 & String, File> <- File.open(temporary, "w")
344 write.opened(directory, retained_temporary, final_path,
345 ByteSstFile.encode_file(entries, 0), opened)