We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 3108499 commit ec4a4e9Copy full SHA for ec4a4e9
compiler/src/dotty/tools/io/File.scala
@@ -59,7 +59,9 @@ class File(jpath: JPath)(implicit constructorCodec: Codec) extends Path(jpath) w
59
def inputStream() = Files.newInputStream(jpath)
60
61
/** Obtains a OutputStream. */
62
- def outputStream(append: Boolean = false) = Files.newOutputStream(jpath, APPEND)
+ def outputStream(append: Boolean = false) =
63
+ if (append) Files.newOutputStream(jpath, APPEND)
64
+ else Files.newOutputStream(jpath)
65
def bufferedOutput(append: Boolean = false) = new BufferedOutputStream(outputStream(append))
66
67
/** Obtains an OutputStreamWriter wrapped around a FileOutputStream.
0 commit comments