RenameFile

Description:

baRenameFile renames a file or folder.

Platforms:

Windows and Macintosh

Usage:

Result = baRenameFile( FileName , NewName )

Arguments:

String.
FileName is the file/folder to rename.
NewName is the new name for the file/folder.

Returns:

Integer.
Returns 1 if the file was successfully renamed, else 0.

Examples:

Director:
OK = baRenameFile( "c:\data\student.dat" , "c:\data\student.bak" )

Authorware:
OK := baRenameFile( "c:\\data\\student.dat" , "c:\\data\\student.bak" )
 

Notes:

This function will fail if a file called NewName already exists. The full path name to both the FileName and the NewName should be given.

You can also move a file or folder to a different folder if the destination file is on the same drive as the source file. eg: baRenameFile( "c:\data\student.dat", "c:\temp\student.dat" ) moves student.dat file from c:\data to c:\temp.
 

See also:

baFileExists
baDeleteFile