createLinkPointingTo

JVM
JRE7
1.4
@ExperimentalPathApi fun Path.createLinkPointingTo(
    target: Path
): Path

Creates a new link (directory entry) located by this path for the existing file target.

Calling this function may require the process to be started with implementation specific privileges to create hard links or to create links to directories.

Exceptions

FileAlreadyExistsException - if a file with this name already exists (optional specific exception, some implementations may throw a more general one).

UnsupportedOperationException - if the implementation does not support creating a hard link.

See Also

Files.createLink