Topic Path: Symbol Reference > Classes > TIdFTP Class > TIdFTP Methods > Rename Method
ContentsIndexHome
PreviousUpNext
TIdFTP.Rename Method

Change the name of a file on the FTP server file system.

procedure Rename(
    const ASourceFile: string; 
    const ADestFile: string
);
Parameters 
Description 
ASourceFile 
Original file name.
 
ADestFile 
New file name. 

Rename is a procedure used to change the name of an existing file on the remote file system. 

ASourceFile specifies the existing file name. 

ADestFile is the new name to use for the remote file. 

Both ASourceFile and ADestFile allow use of absolute or relative path names in the argument values. If path information is not found in the argument values, the current directory on the remote file system is assumed. 

Rename calls SendCmd using the FTP commands RNFR and RNTO in succession to perform the rename file operation.

Copyright 1993-2006, Chad Z. Hower (aka Kudzu) and the Indy Pit Crew. All rights reserved.
Post feedback to the Indy Docs Newsgroup.