This commit is contained in:
Florian Nücke 2014-03-01 18:00:30 +01:00
commit 49e376b422
2 changed files with 4 additions and 2 deletions

View File

@ -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))
}
}

View File

@ -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))