Skip to content

Commit

Permalink
#63
Browse files Browse the repository at this point in the history
  • Loading branch information
gisma committed Apr 23, 2024
1 parent 41c1e55 commit 95f0331
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions R/gdalControls.R
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,10 @@ setenvGDAL <- function(bin_GDAL = NULL){
#' searchGDALW()
#' }

searchGDALW <- function(DL = "C:",
searchGDALW <- function(DL = "C:/",
quiet=TRUE) {
if (DL=="default") DL <- "C:"
if (DL=="C:") DL <- "C:/"
if (DL=="default") DL <- "C:/"
if (Sys.info()["sysname"] == "Windows") {
if (!exists("GiEnv")) GiEnv <- new.env(parent=globalenv())

Expand All @@ -69,10 +70,10 @@ searchGDALW <- function(DL = "C:",

DL = gsub("\\\\", "/", DL)
DL = gsub("/", "\\\\", DL)
DL = shQuote(DL)
DL = shortPathName(DL)
options(show.error.messages = FALSE)
options(warn=-1)
raw_GDAL <- try(system(paste0("cmd.exe /c dir /B /S ",DL,"gdalinfo.exe"),intern=TRUE))
raw_GDAL <- try(system(paste0("cmd.exe /c WHERE /R ",DL, " ","gdalinfo.exe"),intern=TRUE))
if (identical(raw_GDAL, character(0))) raw_GDAL <- "File not found"
if (any(grepl(raw_GDAL,pattern = "File not found")) | any(grepl(raw_GDAL,pattern = "Datei nicht gefunden"))) {

Expand Down

0 comments on commit 95f0331

Please sign in to comment.