HomeManualTopicsTypesSymbols

std::realpath

resolves the specified pathname

Parameter

path
the path to resolve

Result

resolved_path
the resolved path

Description

On success the resolved path is returned, on failure an appropriate error-object is returned.

This function needs I/O-access rights.

In the resolved path, symbolic links are followed and resolved. Additionally the resolved path is canonicalized. This means that the resolved path is normalized according to the local file system. Especially, redundant slashes are removed or relative paths are resolved.

Example

realpath! $resolved_path "//var/log//../lock" println! resolved_path

Output

/run/lock

Topic

POSIX

See also

std::unlink remove the specified file
std::stat retrieves status information about the specified file
std::lstat