Path.readLink

string readLink() const

Creates a symbolic link at this path pointing to the target.

Parameters

targetThe target path for the symlink. Reads the target of a symbolic link without resolving it. Platform semantics: - POSIX: Uses readlink(2) to return the raw link target bytes as a string. - Windows: Reads the reparse point of the link via DeviceIoControl and returns its substitute name.

Returns

The target path text stored in the symlink, or an empty string

if the path is not a symlink or on error.