fullfile: Build full file name from parts

Description Usage Arguments Value Examples

View source: R/fullfile.R

Description

Build full file name from parts and remove repeated slashes. Similar to MATLAB's function "fulfile"

Usage

1
fullfile(..., ext = "", fsep = .Platform$file.sep)

Arguments

...

character vectors. Long vectors are not supported.

ext

- extension of file name (e.g. ".txt" or "txt")

fsep

the path separator to use (assumed to be ASCII).

Value

A character vector of the arguments concatenated term-by-term and separated by fsep if all arguments have positive length; otherwise, an empty character vector (unlike paste). All slashes are converted to fsep. Double slashes are removed.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
fullfile("a","b","c")
 #> [1] "a/b/c"

fullfile("a/","/b/","/c/")
 #> [1] "a/b/c"

fullfile("a","b\\","c", ext = "txt")
 #> [1] "a/b/c.txt"

fullfile("a","b\\","c", ext = "txt")
 #> [1] "a/b/c.txt"

GegznaV/spMisc documentation built on April 26, 2020, 5:59 p.m.