summaryrefslogtreecommitdiff
path: root/src/compiler/scala/tools/nsc/CompileSocket.scala
diff options
context:
space:
mode:
authormichelou <michelou@epfl.ch>2006-07-18 14:00:49 +0000
committermichelou <michelou@epfl.ch>2006-07-18 14:00:49 +0000
commit068aa4e25a560da99f20b5f91f357fef8f90e8b8 (patch)
treebf0b987237f19ff95d04d385ef647dc90e7c8960 /src/compiler/scala/tools/nsc/CompileSocket.scala
parentccbd600259631c689224cdc206d94db59c8d8967 (diff)
downloadscala-068aa4e25a560da99f20b5f91f357fef8f90e8b8.tar.gz
scala-068aa4e25a560da99f20b5f91f357fef8f90e8b8.tar.bz2
scala-068aa4e25a560da99f20b5f91f357fef8f90e8b8.zip
fixed (quick fix) handling of arguments in nsc/...
fixed (quick fix) handling of arguments in nsc/CompilerCommand.scala
Diffstat (limited to 'src/compiler/scala/tools/nsc/CompileSocket.scala')
-rw-r--r--src/compiler/scala/tools/nsc/CompileSocket.scala30
1 files changed, 5 insertions, 25 deletions
diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala
index e2eae11ff9..bd2cc9824f 100644
--- a/src/compiler/scala/tools/nsc/CompileSocket.scala
+++ b/src/compiler/scala/tools/nsc/CompileSocket.scala
@@ -49,40 +49,20 @@ object CompileSocket {
Some(fulldir)
}
- /** Write a test file to a directory to see if it is writable */
- def dirWritable(dir: File): Boolean = {
- dir.mkdirs
- if(!dir.exists)
- return false
-
- val f = new File(dir, "caniwrite")
-
- try {
- f.createNewFile
- if(!f.canWrite)
- return false
- f.delete
- if(f.exists)
- return false
- } catch {
- case _:java.io.IOException =>
- f.delete
- return false
- }
-
- return true
- }
+ /** Test if file f is a writable directory */
+ def isDirWritable(f: File): Boolean =
+ f.isDirectory && f.canWrite
val potentials =
for {
val trial <- totry
val expanded = expand(trial)
!expanded.isEmpty
- dirWritable(expanded.get)
+ isDirWritable(expanded.get)
}
yield expanded.get
- if(potentials.isEmpty) {
+ if (potentials.isEmpty) {
Console.println("could not find a directory for port files")
exit(1)
} else {