You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm on Linux, and I'm dealing with some paths that, for reasons unknown to me, contain backslashes in the file names. It seems that the fs package abjectly refuses to admit the existence of backslashes:
library(fs)
library(assertthat)
myfile<- tempfile("path with a back\\slash")
system(paste("touch", shQuote(myfile)))
assert_that(file.exists(myfile))
#> [1] TRUE## Fails
assert_that(file_exists(myfile))
#> Error: file_exists(path = myfile) is not TRUEmyfile_tidy<- path_tidy(myfile)
print(myfile_tidy)
#> /var/folders/dt/6dg7l6491fjdpb17tfgld9rc0000gn/T/RtmpHj4ctg/path with a back/slash62c12c0f5718regex_matching_one_backslash<-"\\\\"
assert_that(grepl(regex_matching_one_backslash, myfile))
#> [1] TRUE## Fails
assert_that(grepl(regex_matching_one_backslash, myfile_tidy))
#> Error: grepl(pattern = regex_matching_one_backslash, x = myfile_tidy) is not TRUE
I'm guessing the package is trying to enforce the same path separator for UNIX and Windows systems, but does this mean that paths with backslashes in them are simply not supported at all?
The text was updated successfully, but these errors were encountered:
I'm on Linux, and I'm dealing with some paths that, for reasons unknown to me, contain backslashes in the file names. It seems that the fs package abjectly refuses to admit the existence of backslashes:
Created on 2022-07-21 by the reprex package (v2.0.1)
I'm guessing the package is trying to enforce the same path separator for UNIX and Windows systems, but does this mean that paths with backslashes in them are simply not supported at all?
The text was updated successfully, but these errors were encountered: