Skip to content

Commit ec4a4e9

Browse files
Fix outputStream append flag
1 parent 3108499 commit ec4a4e9

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compiler/src/dotty/tools/io/File.scala

+3-1
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,9 @@ class File(jpath: JPath)(implicit constructorCodec: Codec) extends Path(jpath) w
5959
def inputStream() = Files.newInputStream(jpath)
6060

6161
/** Obtains a OutputStream. */
62-
def outputStream(append: Boolean = false) = Files.newOutputStream(jpath, APPEND)
62+
def outputStream(append: Boolean = false) =
63+
if (append) Files.newOutputStream(jpath, APPEND)
64+
else Files.newOutputStream(jpath)
6365
def bufferedOutput(append: Boolean = false) = new BufferedOutputStream(outputStream(append))
6466

6567
/** Obtains an OutputStreamWriter wrapped around a FileOutputStream.

0 commit comments

Comments
 (0)