IFFILE Conditional branch to label if file exists |
Top Previous Next |
This script command checks for the existence of the specified local file and branches to [ label ] if the file exists. Robo-FTP attempts to open the local file to ascertain if it exists or not, so make sure that you have the proper privileges to access the file. Wildcard characters are not permitted in the [ file name ] argument.
For example:
IFFILE "c:\Program Files\Robo-FTP X.X\thisfile" GOTO found it DASHBOARDMSG "File not found." GOTO done
:found_it DASHBOARDMSG "File was found, uploading now ..." SENDFILE "c:\Program Files\Robo-FTP X.X\thisfile"
:done FTPLOGOFF
The IFFILE command is only for use with local files. A combination of the FTPCD, GETSITEFILE and IFERROR commands is required to branch script execution based on the existence of a specific remote file, for example:
FTPCD "/root/subfolder" GETSITEFILE "thisfile" IFERROR= $ERROR_SUCCESS GOTO found_it DASHBOARDMSG "File not found." GOTO done
:found_it DASHBOARDMSG "File was found, downloading now ..." RCVFILE "thisfile"
:done FTPLOGOFF STOP
Related command(s): IFNFILE, DELETE, WRITEFILE, READFILE, WORKINGDIR, BROWSE |