move

open suspend override fun move(source: Path, target: Path)(source)

Moves a file or directory from the source path to the target path. If the source is a directory, all its contents are moved recursively. If the source is a file, it is moved directly to the target. Ensures operations are performed using IO dispatchers.

Parameters

source

The source path of the file or directory to be moved.

target

The target path where the file or directory should be moved.

Throws

If the source path is neither a file nor a directory, or if any IO error occurs.