In the version of the 24x7 Scheduler (guess v2.0.0) the FTPFileExists internally splits the full file name on the path and the short file name then attempts to set current directory as specified in the path. If that operation fails (luck of permissions for all subdirs in the path) it returns false. You can try v2.0.1 which is available for download on 24x7 home page or whait for v2.1.1 that will be posted sometime this week. The FTPFileExists is implemented differently in these versions so it will not cause such problems. Another workaround is to use FTPDir statement to check for a file, see example below. Dim( dir, string ) Dim( found, boolean ) FTPDir( "server", "loginID", "password", "daily\cvisn\archive\connect", dir ) NotEqual( dir , "", found ) if( found, DOWNLOAD, END ) ... : I have copied the sample scripts/FTP example and changed the values to match : my environment. The FTPFileExists command returns FALSE to "found", : even though the FTPGetFile command gets the file from the remote FTP : server. If I can't get your scripts to work, I can't convince my superiors : to buy the product. : The script returns the wrong value when the FTPFileExists line runs, via the : debugger. (Note: The path daily\cvisn\archive\ is based on a virtual : directory.) : See script below: (Yes, I use valid values in the real script) : Dim process_id, number : Dim found, boolean : // Watch for file on remote FTP site. : FTPFileExists( "server", "loginID", "password", : "daily\cvisn\archive\connect", found ) : // If the file found, : // continue processing, otherwise exit and wait for the next cycle : if( found, DOWNLOAD, END ) : DOWNLOAD: // Download the file from Microsoft FTP site : FTPGetFile ( "server", "loginID", "password", : "daily\cvisn\archive\connect", "c:\\temp\*" ) : // Do something with the downloaded file, for example you can display : // it in the Notepad : Run( "notepad c:\\temp\connect", "", process_id ) : // Delete the file - in a real-world you most likely will do this : // FTPDeleteFile( "ftp.microsoft.com", "", "", : "disclaimer.txt" ) : END: // Done : MailSend( "profile", "" , "recipient", : "Mail Test FTP worked", "" )
|