How to check the INEXISTENCE of a directory on an FTP server in Delphi?

Asked

Viewed 737 times

1

Use the Delphi and the Lazarus to create my applications, what should I do to check the non-existence of a directory contained in a FTP server?

For example, when will you check the non-existence of a local archive, use the commands:

(if not DirectoryExists('C:\Teste') then)

How to do the same on an FTP server?

  • Are you using Tchilkatftp2 ? if you have an ftp.Changeremotedir('Camiodapasta'); and put in an if, it returns 1 if it exists, play the Else if there is no http://www.example-code.com/delphiAx/ftp_dirExists.asp

1 answer

1

If you use Indy (see www.indyproject.org/Sockets/index.EN.aspx), in this library you have a component called Tidftp that has the List() method and the Directorylisting property. Run List() and then process the results in Directorylisting to check which files and directories are present on the server.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.