move

abstract suspend fun move(source: Path, target: Path)(source)

Moves a file or directory from source to target. If the source is a directory, all its contents are moved recursively. Parent directories of the target will be created if they don't exist.

Parameters

source

The source path to move from.

target

The target path to move to.

Throws

IOException

or its inheritor if the source doesn't exist, isn't a file or directory, target already exists, or any I/O error occurs.