From a41f6eefc591876f5bf27b7eff5a5cd45e93a4b6 Mon Sep 17 00:00:00 2001 From: Lex Spoon Date: Sun, 22 Jul 2007 17:00:34 +0000 Subject: when looking for a temporary directory, try to ... when looking for a temporary directory, try to create the necessary parent directories --- src/compiler/scala/tools/nsc/CompileSocket.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/compiler/scala/tools/nsc/CompileSocket.scala b/src/compiler/scala/tools/nsc/CompileSocket.scala index 85c2e273f4..3c6f6d1e93 100644 --- a/src/compiler/scala/tools/nsc/CompileSocket.scala +++ b/src/compiler/scala/tools/nsc/CompileSocket.scala @@ -77,9 +77,12 @@ class CompileSocket { Some(fulldir) } - /** Test if file f is a writable directory */ - def isDirWritable(f: File): Boolean = + /** Try to create directory f, and then see if it can + * be written into. */ + def isDirWritable(f: File): Boolean = { + f.mkdirs() f.isDirectory && f.canWrite + } val potentials = for { -- cgit v1.2.3