Path.copy

void copy(string dest, bool recursive = false) const

Copies the file or directory to a new location.

Parameters

destThe destination path.
recursiveIf true, copy directories recursively.

Throws

NotFoundError when the source does not exist; PathError

(or a subclass) when the copy fails.

Notes: With recursive, symbolic links are never followed: on POSIX each link is recreated at the destination (dangling links included — a broken target never aborts the copy); on Windows links are skipped. Linked directories are not deep-copied.