notExists

Checks if the file located by this path does not exist.

inline fun Path.notExists(vararg options: LinkOption): Boolean(source)
import java.nio.file.Path
import java.nio.file.LinkOption

fun main() {
    val path: Path = Path.of("example.txt")

    if (path.notExists()) {
        println("File ${path} does not exist.")
    } else {
        println("File ${path} exists.")
    }
}

Source