[Swift-commit] r4558 - SwiftApps/SwiftR/Swift/R

tga at ci.uchicago.edu tga at ci.uchicago.edu
Fri Jun 3 13:54:49 CDT 2011


Author: tga
Date: 2011-06-03 13:54:44 -0500 (Fri, 03 Jun 2011)
New Revision: 4558

Modified:
   SwiftApps/SwiftR/Swift/R/Apply.R
Log:
Did not correctly detect when request directory already existed.


Modified: SwiftApps/SwiftR/Swift/R/Apply.R
===================================================================
--- SwiftApps/SwiftR/Swift/R/Apply.R	2011-06-03 18:46:22 UTC (rev 4557)
+++ SwiftApps/SwiftR/Swift/R/Apply.R	2011-06-03 18:54:44 UTC (rev 4558)
@@ -202,10 +202,13 @@
     topdir <- file.path(tmpdir, Sys.info()[["user"]],"SwiftR")
     if (!dir.create(topdir,recursive=TRUE,showWarnings=FALSE, 
             mode=kDIR_MODE)) {
-        oldtopdir <- topdir
-        topdir <- tempdir()
-        warning(paste("Could not create working directory", oldtopdir, 
-                    "instead using", topdir))
+        # Might already have existed
+        if (!file.exists(topdir) && file.info(topdir)$isdir) {
+            oldtopdir <- topdir
+            topdir <- tempdir()
+            warning(paste("Could not create working directory", oldtopdir, 
+                        "instead using", topdir))
+        }
     }
 
     requestdirbase = file.path(topdir, 




More information about the Swift-commit mailing list