Skip to content

Commit

Permalink
Merge pull request #382 from magnusja/feature/sync-writes
Browse files Browse the repository at this point in the history
Make FileBlockDeviceDriver writes sync
  • Loading branch information
magnusja authored Mar 20, 2023
2 parents e5a31e9 + ff76018 commit cc71b96
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class FileBlockDeviceDriver : BlockDeviceDriver {
@Throws(FileNotFoundException::class)
@JvmOverloads
constructor(file: File, byteOffset: Int = 0, blockSize: Int = 512) {
this.file = RandomAccessFile(file, "rw")
this.file = RandomAccessFile(file, "rws")
this.blockSize = blockSize
this.byteOffset = byteOffset
}
Expand All @@ -37,7 +37,7 @@ class FileBlockDeviceDriver : BlockDeviceDriver {
val fos = FileOutputStream(tempFile)
fos.channel.transferFrom(rbc, 0, java.lang.Long.MAX_VALUE)

this.file = RandomAccessFile(tempFile, "rw")
this.file = RandomAccessFile(tempFile, "rws")
this.blockSize = blockSize
}

Expand Down

0 comments on commit cc71b96

Please sign in to comment.