TMPNAME - Set temporary download file name |
Top Previous Next |
The TMPNAME command simplifies the process of outputting files to a temporary location and then moving them to their intended destination only if the transfer is successful. This type of behavior is often required in projects that utilize multiple levels of process automation or need extra fault tolerance because an interrupted download can leave a partial file on your computer.
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 |