Xbasic

FILE.RENAME Function

Syntax

V FILE.Rename(C old_name,C new_name)

Arguments

old_nameCharacter

The file to rename.

new_nameCharacter

The name of the new file.

Description

The FILE.RENAME() method changes the name of a file. You must supply both the original filename ( Old_Filename ) and the New_Filename.

Example

This script will rename any file.

filename = ui_get_file("Rename Which File? ", "All Files (*.*)", "", "X")
if (filename = "") then
    end
end if
newfile = ui_get_file("New Filename", "All Files (*.*)", "", "N")
if (newfile = "") then
    end
end if
FILE.rename(filename, newfile)

See Also