RAD Studio VCL Reference
ContentsIndex
PreviousUpNext
System.Rename Function

Changes the name of an external file.

Pascal
procedure Rename(var F; Newname: string); overload;
procedure Rename(var F; Newname: PChar); overload;
C++
Rename( F, AnsiString Newname);
Rename( F, const char * Newname);

System

The external file associated with F is renamed Newname. Further operations on F operate on the external file with the new name. 

F is a variable of any file type. Newname is a string-type expression or an expression of type PChar if the extended syntax is enabled.

Note: {$I+} handles runtime errors using exceptions. When using {$I-}, use IOResult to check for I/O errors.
 

 

Rename File

Copyright(C) 2008 CodeGear(TM). All Rights Reserved.
What do you think about this topic? Send feedback!