path.join: Construct Path to File

path.joinR Documentation

Construct Path to File

Description

Construct the path to a file from components / / paths in a platform-DEPENDENT way.

Usage

path.join(...)

Arguments

...

character vectors.

Details

When constructing a path to a file, the last absolute path is selected and all trailing components are appended. This is different from \codelink3basefile.path() where all trailing paths are treated as components.

Value

A character vector of the arguments concatenated term-by-term and separated by \string/.

Examples

path.join("/", "test1")

path.join("/path/to/file1", "/path/to/file2")

path.join("//host-name/share-name/path/to/file1", "/path/to/file2")

path.join("testing", "/testing", "~", "~/testing", "//host",
    "//host/share", "//host/share/path/to/file", "not-an-abs-path")

path.join("/test1", "test2", "test3")

path.join("test1", "/test2", "test3", "//host/share/test4", "test5",
    "/test6", "test7", "test8", "test9")

this.path documentation built on June 30, 2024, 1:07 a.m.