Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

rename

Renames or moves a file.

Renames the file OLDNAME to NEWNAME. If NEWNAME already exists, it is replaced atomically (on the same filesystem). Cannot move files across filesystem boundaries. Uses std::fs::rename. Returns 1 on success, 0 on failure (and sets $!).

Synopsis

rename $old, $new or die "Cannot rename: $!";
rename 'file.tmp', 'file.dat';

See Also

unlink, link, File::Copy