Name

Rename Procedure

Syntax

procedure Rename(var F: File; const NewName: string);
procedure Rename(var F: TextFile; const NewName: string);

Description

The Rename procedure renames a file. You must call AssignFile first to assign the current filename. If the file cannot be renamed, the Windows error code is reported as an I/O error.

See Also

AssignFile Procedure, Erase Procedure, File Keyword, IOResult Function, TextFile Type

Get Delphi in a Nutshell now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.