TMPNAME - Set temporary download file name
<< Click to Display Table of Contents >> Navigation: Robo-FTP User's Guide > Script Programming > Script Commands > All Script Commands > TMPNAME - Set temporary download file name |
Syntax: |
TMPNAME |
[ prefix ] [ suffix ] |
Arguments: |
[ prefix ] |
|
|
[ suffix ] |
|
Options: |
None |
For some processes that generate a file on the local computer, such as decrypting, unzipping, or downloading a file, it is sometimes preferable to output that file to a temporary local location and then move it to its final location. This type of behavior is often required in projects that utilize multiple levels of process automation or need extra fault tolerance because a failure such as an interrupted download can leave a partial file on your computer. Issue the TMPNAME command before the command that generates the output file (RCVFILE, ZIP, UNZIP, PGPDECRYPT, and PGPENCRYPT) to enable this behavior. If the command fails, the partial file for the interrupted process will automatically be deleted, with the exception of the RCVFILE command when used with the /resume option.
The [ prefix ] argument allows you to specify a string that will be automatically prepended to file names as the files are downloaded. The prefix is automatically removed once the download has successfully completed. If you do not want to add a prefix then you must pass an empty string to this argument.
TMPNAME "PARTIAL_" ""
RCVFILE "data.xml" ;; temp file is named PARTIAL_data.xml
TMPNAME "c:\temp\" ""
RCVFILE "data.xml" ;; temp file is named c:\temp\data.xml
The [ suffix ] argument allows you to specify a string that will be automatically appended to file names as the files are downloaded. The suffix is automatically removed once the download has successfully completed. If you do not want to add a suffix then you must pass an empty string to this argument.
TMPNAME "" ".part"
RCVFILE "data.xml" ;; temp file is named data.xml.part
You can even use both [ prefix ] and [ suffix ] together:
TMPNAME "c:\temp\" ".part"
RCVFILE "data.xml" ;; temp file is named c:\temp\data.xml.part
Call the TMPNAME command omitting both the [ prefix ] and [ suffix ] to disable temporary names.
TMPNAME ;; disable temp names
Note: When the TMPNAME command is active it affects downloaded files as well as output files created by the PGPENCRYPT, PGPDECRYPT, ZIP and UNZIP commands.
Related command(s): FTPTMPNAME, RCVFILE, AUDITDB
See also: Fault Tolerant Scripts