RSCMDSTATUS Check status of non-blocking remote server command |
Top Previous Next |
This command requires the server be the Robo-FTP Server from Serengeti Systems.
This command may be used to check for the completion status of non-blocking remote server command(s) issued by Robo-FTP using the RSCMD script command and for the completion of a cancel request issued using the RSCMDCANCEL script command.
Important Remote server commands are only permitted using Robo-FTP in concert with its companion Robo-FTP Server product - both products of Serengeti Systems Incorporated.
The following example shows how a script file may be uploaded to the server and then run under control of Robo-FTP and how Robo-FTP monitors for completion of the script.
SENDFILE "findnewest.s" RSCMD "CALL 'findnewest.s'" IFERROR $ERROR_RSCMD_INITIATED GOTO script_running ;;script launch failed GOTO script_error :script_running ;;delay script for one second PAUSE /for=1 RSCMDSTATUS IFERROR!= $ERROR_SUCCESS GOTO script_running :script_done
In some cases the server-side script will fail resulting in a result code that you may wish to test in the local script. When Robo-FTP Server reports an abnormal script completion to Robo-FTP, it includes the non-zero script result code. In such cases, Robo-FTP saves the server side result code (see Using Script File Result Codes) in the %rscmderror script variable. An expansion of the previous example shows how this script variable might be used.
SENDFILE "findnewest.s" RSCMD "CALL 'findnewest.s'" IFERROR $ERROR_RSCMD_INITIATED GOTO script_running ;;script launch failed GOTO script_error :script_running ;;delay script for one second PAUSE /for=1 RSCMDSTATUS IFERROR!= $ERROR_RSCMD_FAILED GOTO script_still_running MESSAGEBOX %rscmderror "Server Script Command Error Below" GOTO script_failed :script_still_running IFERROR!= $ERROR_SUCCESS GOTO script_running :script_done ;;... :script_failed
The /timeout option is usually not necessary. There is a default time-out of 30 seconds on the return of the RSCMDSTATUS command. In rare cases where a normal (non-error) return takes more than 30 seconds, use this option to specify a time-out period that better suits your environment.
Related Command(s): RSCMD , RSCMDCANCEL
|