asAbsolutePath
fn
auto asAbsolutePath(R)(R path) if ((isRandomAccessRange!R && isSomeChar!(ElementType!R) ||
isNarrowString!R) &&
!isConvertibleToString!R)Transforms path into an absolute path.
The following algorithm is used:
- If
pathis empty, returnnull. - If
pathis already absolute, return it. - Otherwise, append
pathto the current working directory,which allocates memory.
Note that asAbsolutePath will not normalize `..` segments. Use asNormalizedPath(asAbsolutePath(path)) if that is desired.
Parameters
path | the relative path to transform |
Returns
the transformed path as a lazy range
See Also
absolutePath which returns an allocated string