From 4696fe11176a14d327aff06ba64cd0fc4912adc6 Mon Sep 17 00:00:00 2001 From: --replace-all <helge.marc.ole.jentsch@uni-hamburg.de> Date: Mon, 28 Aug 2023 19:39:42 +0200 Subject: [PATCH] update removing the error while downloading on non-windows machines --- R/auxiliary.R | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/R/auxiliary.R b/R/auxiliary.R index 21b6a1d..75d6b67 100644 --- a/R/auxiliary.R +++ b/R/auxiliary.R @@ -592,7 +592,11 @@ getDownloadSize <- function(URLVector){ filesizes <- sum(filesizes,fileISize) # return(Downloadsize) } - availDiscSpaceMB <- as.numeric(stringr::str_remove(base::system("wmic logicaldisk get freespace", inter=TRUE)[2], pattern = " \r"))/1024/1024 + if(Sys.info()[names(Sys.info()) == "sysname"] == "Windows"){ + availDiscSpaceMB <- as.numeric(stringr::str_remove(base::system("wmic logicaldisk get freespace", inter=TRUE)[2], pattern = " \r"))/1024/1024 + } + # else if(Sys.info()[names(Sys.info()) == "sysname"] != "Windows"){ + # } # if(availDiscSpaceMB < round(filesizes*0.000001, 2)){ # print(paste0(round(filesizes*0.000001, 2),"MB will be downloaded. These is only ", availDiscSpaceMB, "MB available. Please consider another download location.")) # } -- GitLab