Newsgroups : Borland : borland.public.delphi.internet.winsock : 2008 Jun : How to know if TIdFTP commands fail???

www.cryer.info
Managed Newsgroup Archive

How to know if TIdFTP commands fail???

Subject:How to know if TIdFTP commands fail???
Posted by:"Bo Berglund" (bo.berglu..@system3r.se)
Date:Sun, 22 Jun 2008 20:32:31

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.

--
Bo Berglund

Replies:

www.cryer.info
Managed Newsgroup Archive