Re: FTPFileSystem.RenameFile

Giganews Newsgroups
Subject: Re: FTPFileSystem.RenameFile
Posted by:  Remy Lebeau (Indy Team) (no.spam@no.spam.com)
Date: Tue, 17 Apr 2007

"Johan Nilsson" <input_remove_@home.se> wrote in message
news:FD9C6E49B722E340input_remove_@home.se...

> shouldn't the TIdFTPBaseFileSystem.RenameFile include a
> ARenameFromFile-parameter?

The source filename is available in the RNFR property of the
TIdFTPServerContextBase that is passed to RenameFile().  If you look
at where TIdFTPServer is calling DoOnRenameFile(), it is passing the
RNFR property value as the ARenameFromFile parameter.  So if anything,
I would suggest removing the ARenameFromFile parameter from
TIdFTPServer.DoOnRenameFile() instead of adding an ARenameFromFile
parameter to TIdFTPBaseFileSystem.RenameFile(), ie:

    procedure TIdFTPServer.DoOnRenameFile(ASender:
TIdFTPServerContext; const ARenameToFile: string);
    begin
        if Assigned(FFTPFileSystem) then begin
            FFTPFileSystem.RenameFile(ASender, ARenameToFile);
        end else if Assigned(FOnRenameFile) then begin
            FOnRenameFile(ASender, ASender.FRNFR, ARenameToFile);
        end;
    end;

Gambit

Replies

In response to

FTPFileSystem.RenameFile posted by Johan Nilsson on Tue, 17 Apr 2007