deleteRecursively

common
open fun deleteRecursively(fileOrDirectory: Path)

Recursively deletes all children of fileOrDirectory if it is a directory, then deletes fileOrDirectory itself.

This function does not defend against race conditions. For example, if child files are created or deleted in fileOrDirectory while this function is executing, this may fail with an IOException.

Throws

if any metadata, list, or delete operation fails.

js
open fun deleteRecursively(fileOrDirectory: Path)

Throws