deleteIfExists

Deletes the file or empty directory specified by this path if it exists.

Since Kotlin

1.5

Return

true if the existing file was successfully deleted, false if the file does not exist.

See also

Throws

if the directory exists but is not empty