Bo Berglund
2008-06-22 18:32:31 UTC
I am exploring the use of TIdFTP to handle some files on a FTP server.
I need to do the following functions:
- Check if a file exists
- Delete an existing file
- Rename an existing file
- Change the current dir on the FTP server
- Transfer a file to and from the FTP server
The TIdFTP component has the following methods that seemingly will be
useful:
procedure List(ADest: TStrings; const ASpecifier: string = ''; const
ADetails: boolean = true);
procedure Delete(const AFilename: string);
procedure Rename(const ASourceFile: string; const ADestFile: string);
procedure ChangeDir(const ADirName: string);
procedure Get(const ASourceFile: string; const ADestFile: string;
const ACanOverwrite: boolean = false; AResume: Boolean = false);
overload;
procedure Put(const ASourceFile: string; const ADestFile: string = '';
const AAppend: boolean = false); overload;
The first problem I see here that all these methods are *procedures*
so HOW can I know if the operation failed???
Also when specifying a file to operate on should it include a path or
just a simple file name in the current dir?
If a path, then how should it be formatted?
And after changing the current dir, how can I check the dir on the
server.
I am using the latest Indy10 snapshot on Delphi 7.
I need to do the following functions:
- Check if a file exists
- Delete an existing file
- Rename an existing file
- Change the current dir on the FTP server
- Transfer a file to and from the FTP server
The TIdFTP component has the following methods that seemingly will be
useful:
procedure List(ADest: TStrings; const ASpecifier: string = ''; const
ADetails: boolean = true);
procedure Delete(const AFilename: string);
procedure Rename(const ASourceFile: string; const ADestFile: string);
procedure ChangeDir(const ADirName: string);
procedure Get(const ASourceFile: string; const ADestFile: string;
const ACanOverwrite: boolean = false; AResume: Boolean = false);
overload;
procedure Put(const ASourceFile: string; const ADestFile: string = '';
const AAppend: boolean = false); overload;
The first problem I see here that all these methods are *procedures*
so HOW can I know if the operation failed???
Also when specifying a file to operate on should it include a path or
just a simple file name in the current dir?
If a path, then how should it be formatted?
And after changing the current dir, how can I check the dir on the
server.
I am using the latest Indy10 snapshot on Delphi 7.
--
Bo Berglund
Bo Berglund