Browse code

Fix issue #141

Yihang Xin authored on 16/06/2021 00:42:42 • Alexander Pico committed on 16/06/2021 01:27:33
Showing 2 changed files

... ...
@@ -184,7 +184,12 @@ getAbsSandboxPath <- function(fileLocation){
184 184
     boxName <- box[[1]]
185 185
     boxPath <- box[[2]]
186 186
     if (is.null(boxName)){
187
-        return(file.path(getwd(),fileLocation)) 
187
+        if(isAbsolutePath(fileLocation)){
188
+            filePath <- fileLocation
189
+        } else {
190
+            filePath <- (file.path(getwd(), fileLocation)) 
191
+        } 
192
+        return(filePath)
188 193
     } else if (!is.null(boxName) && !is.null(boxPath)){
189 194
         return(paste(boxPath, fileLocation, sep="/"))
190 195
     } else {
... ...
@@ -97,7 +97,11 @@ sandboxGetFileInfo <- function(fileName, sandboxName=NULL, base.url=.defaultBase
97 97
         },
98 98
         error = function(e){
99 99
             if(is.null(sandboxName) && is.null(getCurrentSandboxName()) && !is.null(fileName) && !is.null(trimws(fileName))){
100
+                if(isAbsolutePath(fileName)){
101
+                    filePath <- fileName
102
+                } else {
100 103
                 filePath <- (file.path(getwd(), fileName)) 
104
+                }
101 105
                 if (file.exists(filePath)){
102 106
                     isFile <- utils::file_test("-f", fileName)
103 107
                     modifiedTime <- format(file.info(fileName)$mtime, usetz=FALSE)