diff options
author | Paul Phillips <paulp@improving.org> | 2009-08-31 20:19:46 +0000 |
---|---|---|
committer | Paul Phillips <paulp@improving.org> | 2009-08-31 20:19:46 +0000 |
commit | d9a7d026ce8d48c9bf9d8eb669a3a9430105120e (patch) | |
tree | a77ec5f73530c8370c99a0f0b8b1eac0c042b951 /src/library | |
parent | c918b70784d41b0aa7efe5eea74e5ec7a4224421 (diff) | |
download | scala-d9a7d026ce8d48c9bf9d8eb669a3a9430105120e.tar.gz scala-d9a7d026ce8d48c9bf9d8eb669a3a9430105120e.tar.bz2 scala-d9a7d026ce8d48c9bf9d8eb669a3a9430105120e.zip |
One more try to unbreak fsc all the way.
Diffstat (limited to 'src/library')
-rw-r--r-- | src/library/scala/io/Path.scala | 4 | ||||
-rw-r--r-- | src/library/scala/xml/persistent/CachedFileStorage.scala | 2 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/library/scala/io/Path.scala b/src/library/scala/io/Path.scala index 043cb3e66b..3d2bfaeca5 100644 --- a/src/library/scala/io/Path.scala +++ b/src/library/scala/io/Path.scala @@ -151,6 +151,10 @@ class Path private[io] (val jfile: JFile) def ensureDirectory(force: Boolean = true): Directory = if (this.isDirectory) this.toDirectory else createDirectory(force) + /** This is temporary while I try to unbreak fsc. */ + def ensureFile(): File = + if (this.isFile) this.toFile else createFile() + // deletions def delete() = jfile.delete() def deleteIfExists() = if (jfile.exists()) delete() else false diff --git a/src/library/scala/xml/persistent/CachedFileStorage.scala b/src/library/scala/xml/persistent/CachedFileStorage.scala index 17194b4421..8b3907b7f5 100644 --- a/src/library/scala/xml/persistent/CachedFileStorage.scala +++ b/src/library/scala/xml/persistent/CachedFileStorage.scala @@ -81,7 +81,7 @@ extends java.lang.Thread with scala.util.logging.Logged log("[save]\ndeleting "+theFile); theFile.delete(); log("creating new "+theFile); - theFile.createFile(); + theFile.ensureFile(); val fos = theFile.outputStream() val c = fos.getChannel() |