Create an absolute file path from a relative file path. All processing is purely lexical; the path itself does not have to exist on the filesystem.

absolutizePath(path)

Arguments

path

String containing an absolute or relative file path.

Value

An absolute file path corresponding to path. This is cleaned to remove .., . and ~ components.

Author

Aaron Lun

Examples

absolutizePath("alpha")
#> [1] "/__w/alabaster.base/alabaster.base/docs/reference/alpha"
absolutizePath("../alpha")
#> [1] "/__w/alabaster.base/alabaster.base/docs/alpha"
absolutizePath("../../alpha/./bravo")
#> [1] "/__w/alabaster.base/alabaster.base/alpha/bravo"
absolutizePath("/alpha/bravo")
#> [1] "/alpha/bravo"