normalized_file_path: Platform-Independent Normalized File Paths

Description Usage Arguments Value Examples

Description

Combines normalizePath and file.path to produce normalized canonical paths for files in a platform-independent fashion.

Usage

1
2
3
4
5
6
normalized_file_path(
  ...,
  fsep = .Platform$file.sep,
  winslash = "\\",
  mustWork = NA
)

Arguments

...

character vectors for file paths. See file.path.

fsep

Path separator to use (assumed to be ASCII). See file.path.

winslash

Separator to be used on Windows - ignored elsewhere. See normalizePath.

mustWork

logical: if TRUE then an error is given if the result cannot be determined; if NA, then a warning. See normalizePath.

Value

character vector of the full file paths. See normalizePath and file.path.

Examples

1
2
3
4
5
 normalized_file_path("~")
 normalized_file_path(".", "folder", "file.ext", mustWork = FALSE)
 # compare to 
 normalizePath(c(".", "folder", "file.ext"), mustWork = FALSE)
 file.path(".", "folder", "file.ext")

weecology/directree documentation built on Dec. 23, 2021, 5:09 p.m.