createLinkPointingTo

Platform and version requirements: JVM (1.5), JRE7 (1.5)
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

© 2010–2021 JetBrains s.r.o. and Kotlin Programming Language contributors
Licensed under the Apache License, Version 2.0.
https://kotlinlang.org/api/latest/jvm/stdlib/kotlin.io.path/java.nio.file.-path/create-link-pointing-to.html