Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

naming a file

Status
Not open for further replies.

agua00

Technical User
Jul 13, 2004
5
US
how do i write a script to name a file that I am downloading to my pc via procomm
 
What you need to do is grab the value of $XFERFILE while the download is underway, then you can rename that file to a different name. The code would look something like this:

getfile ZMODEM
iStatus = $XFERSTATUS
while iStatus == 1
yield
if nullstr sDownloadFile
sDownloadFile = $XFERFILE
endif
endwhile
if iStatus == 2
rename sDownloadFile sRenameFile
endif

where iStatus is an integer and sDownloadFile and sRenameFile are strings.


aspect@aspectscripting.com
 
knob - is there some other setting I need to change because the ReceiveFile2.was script is not renaming the file downloaded via zmodem. I've updated the script to indicate the value of the sDownloadFile variable and it is always a blank.

Code:
proc main

   integer iStatus
   string sDownloadFile
getfile ZMODEM
iStatus = $XFERSTATUS
while iStatus == 1
   yield
   if nullstr sDownloadFile
      sDownloadFile = $XFERFILE
   endif
endwhile

usermsg sDownloadFile

endproc
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top