Using the %lastfile and %lastpath Variables

<< Click to Display Table of Contents >>

Navigation:  Robo-FTP User's Guide > Script Programming > Internal Script Variables >

Using the %lastfile and %lastpath Variables

 

When a file transfer is attempted using either the SENDFILE or RCVFILE command, the file's name is stored in the %lastfile internal variable and the full name including drive and folder path is stored in the %lastpath internal variable.

 

These variables are useful for error reporting, for example:

 

SENDFILE "*.txt"

IFERROR= $ERROR_SUCCESS GOTO done

SET body = "An error occurred [" + %lasterror "] while attempting to upload " + %lastpath + %crlf  

SET from = "Robo-FTP Upload Script"

SET email = "[email protected]"

SET subj = "Whoops!"

CREATEMAIL from email subj body ""

SENDMAIL "smtp.mydomain.com" "FTP Administrator" "[email protected]"

:done

 

 

See also: Internal Script Variables