copy

abstract fun copy(source: Path, target: Path)(source)

Copies all the bytes from the file at source to the file at target. This does not copy file metadata like last modified time, permissions, or extended attributes.

This function is not atomic; a failure may leave target in an inconsistent state. For example, target may be empty or contain only a prefix of source.

Throws

IOException

if source cannot be read or if target cannot be written.