SoftTree Technologies SoftTree Technologies
Technical Support Forums
RegisterSearchFAQMemberlistUsergroupsLog in
FTPFileExists returns bogus value

 
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite View previous topic
View next topic
FTPFileExists returns bogus value
Author Message
Gary Jensen



Joined: 22 Mar 2000
Posts: 28

Post FTPFileExists returns bogus value Reply with quote

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", "" )


Tue Apr 18, 2000 12:53 pm View user's profile Send private message
SysOp
Site Admin


Joined: 26 Nov 2006
Posts: 6502

Post Re: FTPFileExists returns bogus value Reply with quote

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", "" )

Tue Apr 18, 2000 1:10 pm View user's profile Send private message
Display posts from previous:    
Reply to topic    SoftTree Technologies Forum Index » 24x7 Scheduler, Event Server, Automation Suite All times are GMT - 4 Hours
Page 1 of 1

 
Jump to: 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


 

 

Powered by phpBB © 2001, 2005 phpBB Group
Design by Freestyle XL / Flowers Online.