makefullpath: Combine Path and Filename into Filename with Path

Description Usage Arguments Details Value Author(s) See Also Examples

View source: R/param.r

Description

Combine a path with a filename into filename with path.

Usage

1
makefullpath(path, filename)

Arguments

path

Path, relative to which the filename is expected to be. Can be absolute, relative, or NULL.

filename

Can be just filename, include relative path, or include absolute path.

Details

Function returns filename if it includes absolute path or if path is NULL.

Value

Filename with the path included.

Author(s)

Andrey A Shabalin andrey.shabalin@gmail.com

See Also

See also isAbsolutePath.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
makefullpath("dir1/dir2", "file.txt")
# "dir1/dir2/file.txt"

makefullpath("dir1/dir2", "dir3/file.txt")
# "dir1/dir2/dir3/file.txt"

# Path is ignored if the filename already includes absolute path

makefullpath("dir1/dir2", "/file.txt")
# "/file.txt"

makefullpath("dir1/dir2", "C:/file.txt")
# "C:/file.txt"

ramwas documentation built on Nov. 8, 2020, 8:24 p.m.