R/helper_fix_paths.R

Defines functions unfix_windows_path fix_windows_path

fix_windows_path <- function(path) {
  path <- gsub("\\\\", "/", path)

  start <-
    gsub("^([a-zA-Z]):/.*", "/\\1", path) %>%
    tolower

  gsub("[^:/]:", start, path)
}

unfix_windows_path <- function(path) {
  gsub("^/c/", "C:/", path)
}


fix_macosx_tmp <- function (path) {
  gsub("^/var/", "/tmp/", path)
}

Try the babelwhale package in your browser

Any scripts or data that you put into this service are public.

babelwhale documentation built on July 26, 2023, 5:24 p.m.