diff options
Diffstat (limited to 'src/compiler/scala/tools/nsc/io/File.scala')
-rw-r--r-- | src/compiler/scala/tools/nsc/io/File.scala | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/src/compiler/scala/tools/nsc/io/File.scala b/src/compiler/scala/tools/nsc/io/File.scala index b11151ab7e..cc512493d9 100644 --- a/src/compiler/scala/tools/nsc/io/File.scala +++ b/src/compiler/scala/tools/nsc/io/File.scala @@ -17,14 +17,14 @@ import java.nio.channels.{ Channel, FileChannel } import scala.io.Codec object File { - def pathSeparator = JFile.pathSeparator - def separator = JFile.separator + def pathSeparator = java.io.File.pathSeparator + def separator = java.io.File.separator def apply(path: Path)(implicit codec: Codec) = new File(path.jfile)(codec) // Create a temporary file, which will be deleted upon jvm exit. def makeTemp(prefix: String = Path.randomPrefix, suffix: String = null, dir: JFile = null) = { - val jfile = JFile.createTempFile(prefix, suffix, dir) + val jfile = java.io.File.createTempFile(prefix, suffix, dir) jfile.deleteOnExit() apply(jfile) } @@ -43,20 +43,23 @@ object File { // trigger java.lang.InternalErrors later when using it concurrently. We ignore all // the exceptions so as not to cause spurious failures when no write access is available, // e.g. google app engine. - try { - import Streamable.closing - val tmp = JFile.createTempFile("bug6503430", null, null) - try closing(new FileInputStream(tmp)) { in => - val inc = in.getChannel() - closing(new FileOutputStream(tmp, true)) { out => - out.getChannel().transferFrom(inc, 0, 0) - } - } - finally tmp.delete() - } - catch { - case _: IllegalArgumentException | _: IllegalStateException | _: IOException | _: SecurityException => () - } + // + // XXX need to put this behind a setting. + // + // try { + // import Streamable.closing + // val tmp = java.io.File.createTempFile("bug6503430", null, null) + // try closing(new FileInputStream(tmp)) { in => + // val inc = in.getChannel() + // closing(new FileOutputStream(tmp, true)) { out => + // out.getChannel().transferFrom(inc, 0, 0) + // } + // } + // finally tmp.delete() + // } + // catch { + // case _: IllegalArgumentException | _: IllegalStateException | _: IOException | _: SecurityException => () + // } } import File._ import Path._ |