FTPExistDir

FTP function.

The FTPExistDir function checks if the specified FTP foldername exists or not.

Syntax

ret=FTPExistDir(<FTP_foldername>)

Parameter

<FTP_foldername> : string, name of the folder to check the existence.

Return value

Ret, numeric return code. The return code is 1 if <FTP_foldername> exists, 0 if not. During #FTPTimeout seconds, the function tries to check the existence of the specified folder. After this timeout, the script executes the next line whatever value for #IgnoreErrors (script execution does not stop even if a FTP error is returned).

See also

FTPCurrentDir, FTPChDir, FTPRmDir, FTPExistFile

Example

 

FtpConnect("www.wintask.com","ftp","MX/WH05CZE3h") ' connection to the FTP server www.wintask.com (fake credentials!)

ret=FTPExistDir("/todelete") ' if ret returns 1, the FTP folder /todelete exists.

If ret = 1 then
  FTPRmDir("/todelete") 'Delete the folder if it exists.
EndIf
FtpDisconnect() ' Terminates the FTP connection