vl-file-rename (AutoLISP)

Renames a file

Supported Platforms: Windows and Mac OS

Signature

(vl-file-rename old-filename new-filename)
old-filename

Type: String

Name of the file you want to rename. If you do not specify a full path name, vl-file-rename looks in the AutoCAD default drawing directory.

new-filename

Type: String

New name to be assigned to the file.

Note: If you do not specify a path name, vl-file-rename writes the renamed file to the AutoCAD default drawing directory.

Return Values

Type: T or nil

T, if renaming completed successfully; nil if renaming failed.

Note: If the target file already exists, this function fails.

Examples

Windows
(vl-file-rename "c:/newauto.bat" "c:/myauto.bat")
T
Mac OS
(vl-file-rename "/oldstartup.sh" "/mystartup.sh")
T