Skip to content

Commit cc71b96

Browse files
authored
Merge pull request #382 from magnusja/feature/sync-writes
Make FileBlockDeviceDriver writes sync
2 parents e5a31e9 + ff76018 commit cc71b96

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

libaums/src/main/java/me/jahnen/libaums/core/driver/file/FileBlockDeviceDriver.kt

+2-2
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ class FileBlockDeviceDriver : BlockDeviceDriver {
2222
@Throws(FileNotFoundException::class)
2323
@JvmOverloads
2424
constructor(file: File, byteOffset: Int = 0, blockSize: Int = 512) {
25-
this.file = RandomAccessFile(file, "rw")
25+
this.file = RandomAccessFile(file, "rws")
2626
this.blockSize = blockSize
2727
this.byteOffset = byteOffset
2828
}
@@ -37,7 +37,7 @@ class FileBlockDeviceDriver : BlockDeviceDriver {
3737
val fos = FileOutputStream(tempFile)
3838
fos.channel.transferFrom(rbc, 0, java.lang.Long.MAX_VALUE)
3939

40-
this.file = RandomAccessFile(tempFile, "rw")
40+
this.file = RandomAccessFile(tempFile, "rws")
4141
this.blockSize = blockSize
4242
}
4343

0 commit comments

Comments
 (0)