rename-file

rename-file is an interactive built-in function in `C source code'.


(rename-file FILE NEWNAME &optional OK-IF-ALREADY-EXISTS)

Rename FILE as NEWNAME. Both args must be strings.
If file has names other than FILE, it continues to have those names.
Signals a `file-already-exists' error if a file NEWNAME already exists
unless optional third argument OK-IF-ALREADY-EXISTS is non-nil.
A number as third arg means request confirmation if NEWNAME already exists.
This is what happens in interactive use with M-x.