From 8527d64d754a1dc4e5974d5795761dd05cd68f31 Mon Sep 17 00:00:00 2001 From: jorainer Date: Fri, 17 May 2024 08:15:49 +0200 Subject: [PATCH] fix: paths for Windows --- R/MsBackendMzR.R | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/R/MsBackendMzR.R b/R/MsBackendMzR.R index 2e8cafd1..7cadc0d5 100644 --- a/R/MsBackendMzR.R +++ b/R/MsBackendMzR.R @@ -223,10 +223,12 @@ setMethod("dataStorageBasePath", "MsBackendMzR", function(object) { setReplaceMethod( "dataStorageBasePath", "MsBackendMzR", function(object, value) { ds <- dataStorage(object) + ds <- gsub("\\", "/", ds, fixed = TRUE) + value <- gsub("\\", "/", value, fixed = TRUE) cp <- common_path(ds) ds <- sub(cp, value, ds, fixed = TRUE) if (!all(file.exists(unique(ds)))) stop("Provided path does not contain all data files.") - dataStorage(object) <- ds + dataStorage(object) <- normalizePath(ds) object })