Documentation for method rename

Documentation for method rename, assembled from the following types:

class IO::Path

From IO::Path

(IO::Path) routine rename

method rename(IO::Path:D: $to:$createonly --> Bool)
sub    rename($from$to:$createonly --> Bool)

Renames a file. Both $from (the file to be renamed) and $to (the destination) can take arbitrary paths. If :createonly is set to True, the rename fails if a file already exists in the destination. Returns True upon success, or fails with X::IO::Rename if the operation could not be completed.

Please use move if a file could not be moved by renaming (usually because the destination is on a different physical storage device).