diff --git a/R/utils.R b/R/utils.R index 09b69974..c3355ab2 100644 --- a/R/utils.R +++ b/R/utils.R @@ -776,8 +776,11 @@ ensureDirectory <- function(path) { return(path) } else if (identical(info$isdir, FALSE)) { stop("path '", path, "' exists but is not a directory") - } else if (!dir.create(path, recursive = TRUE)) { - stop("failed to create directory at path '", path, "'") + } else { + dir.create(path, recursive = TRUE, showWarnings = FALSE) + if (!file.info(path)$isdir) { + stop("failed to create directory at path '", path, "'") + } } path