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 strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

getfile with download path specified will not compile 1

Status
Not open for further replies.

PS2GT3

Programmer
Jun 26, 2003
8
IE
I cannot get a script to compile successfully whilst trying to reference another download path other than that specified in the data options->paths setting.

I've tried

1. getfile ZMODEM "c:\abc\def"

2. getfile ZMODEM c:\abc\def

I've tried

3.

string dn_path

dn_path = "c:\abc\def"

getfile ZMODEM dn_path

the script compiler does like it

Anyone out there know why?
 
Zmodem and Kermit are able to receive the name of the transferred file during the intialization of the transfer, so that is why you cannot specify a filename or path for the downloaded file. I have a script here:


that shows how to monitor the transfer process, intercept the name of the file, and then rename (or copy it in your case) to the desired value.


 
Knob

Thanks for the update, this does work if only one file is being transferred but not for many files i.e. *.doc

How do I intercept each file downloaded and then move it to another folder keeping its original filename?

TIA
 
Here is a modification of a script I had sitting around that uses when $XFERSTATUS to call a procedure each time $XFERSTATUS changes to a non-zero value. It worked well with a four file batch transfer I just tried it with.

proc main
when $XFERSTATUS call getit ;Call getit procedure when transfer begins

while 1
yield
endwhile
endproc

proc getit
integer iStatus
string sDownloadFile ;Fully-qualified filename being downloaded
string sRenameFile ;Fully-qualified filename to rename downloaded file to

iStatus = $XFERSTATUS
while iStatus == 1
if nullstr sDownloadFile
sDownloadFile = $XFERFILE
endif
iStatus = $XFERSTATUS
endwhile
if iStatus == 2
;Transfer successful, continue with script execution
rename sDownloadFile sRenameFile ;Rename downloaded file to desired name
elseif iStatus == 3
;Transfer failed, perform error handling
endif
endproc

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top