mirror of
https://github.com/MightyPirates/OpenComputers.git
synced 2025-09-17 11:15:12 -04:00
fixed opening files in write mode when using unbuffered mode (filesystem.bufferChanges = false), fixes #144
This commit is contained in:
parent
c059c7b90b
commit
6f6727d1f0
@ -78,6 +78,9 @@ trait Capacity extends OutputStreamFileSystem {
|
||||
case None => None
|
||||
case Some(stream) =>
|
||||
used += delta
|
||||
if (mode == Mode.Append) {
|
||||
stream.seek(stream.length())
|
||||
}
|
||||
Some(new CountingOutputHandle(this, stream))
|
||||
}
|
||||
}
|
||||
|
@ -23,8 +23,7 @@ trait FileOutputStreamFileSystem extends FileInputStreamFileSystem with OutputSt
|
||||
|
||||
override protected def openOutputHandle(id: Int, path: String, mode: Mode): Option[OutputHandle] =
|
||||
Some(new FileHandle(new RandomAccessFile(new io.File(root, path), mode match {
|
||||
case Mode.Append => "a"
|
||||
case Mode.Write => "w"
|
||||
case Mode.Append | Mode.Write => "rw"
|
||||
case _ => throw new IllegalArgumentException()
|
||||
}), this, id, path))
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user