Board index » delphi » TIdFtp.list problem

TIdFtp.list problem

hi all,

i try to get the ftpserver directory with :

   ftp.list( dirlist, '', true )
( i use '' as filespec because i only want to have the files and
directories in the
current directory , i use true because i want to identify if it is a
dircetory)

if the current working directory is empty i get an exception (ftp server
returns 550 No Files.)
I took a look at  TIdFTP.InternalGet(const ACommand: string; ADest:
TStream);
there only 125 and 150 are defined as valid results. But i think "No
Files" is also a valid result. Or am i wrong?

Can anyone give me some help;

Thanks
Stefan

 

Re:TIdFtp.list problem


In article <3AB70E4A.99D72...@sk-software.de>, k...@sk-software.de
says...

Quote
> hi all,

> i try to get the ftpserver directory with :

>    ftp.list( dirlist, '', true )

> if the current working directory is empty i get an exception (ftp server
> returns 550 No Files.)

Interesting...I had the same issue today doing a short listing
(Details=False). With Details=True, if the filespec matched no files I
got an empty StringList. With Details=False, I got the same exception
you did.

My workaround was just to put the FTP.List in a try..except block and
trap for TidProtocolReplyError. But it would be nice if 550 were an
acceptable response as well.

Aaron Sherber.

Other Threads