home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Simtel MSDOS - Coast to Coast
/
simteldosarchivecoasttocoast2.iso
/
pibterm
/
pibt41e3.zip
/
SENDZMOD.SCR
< prev
next >
Wrap
Text File
|
1988-02-26
|
5KB
|
101 lines
***************************************************************************
* S E N D Z M O D . S C R --- Script interfacing DSZ to PibTerm *
***************************************************************************
* *
* Script: SendZMod.Scr *
* *
* Purpose: Interfaces external Zmodem driver program DSZ.COM *
* to PibTerm for sending files. *
* *
* Invocation: *
* *
* Execute "SendZmod" *
* *
* Remarks: *
* *
* This script is designed to be automatically invoked by the *
* <ALT>R command when Zmodem has been defined as an external *
* protocol at <ALT>P, F)ile transfer, k) external file transfers. *
* *
***************************************************************************
* *
* File spec for files to transfer
Declare FileSpec String
* Baud rate for transfer
Declare BaudRate String
* Comm port number
Declare Port String
* Zmodem block size
Declare Block String
* Build DSZ invocation line in this
Declare Zmodem String
* 'restrict ' for host mode, else null
Declare Restrict String
* Host mode flag
Declare HostMode String
* Saves drive/directory we're in now
Declare CurDrive String
Declare CurDir String
* Host mode download directory =
* directory remote callers can download from.
Declare UpDir String
* Length of directory name
Declare L Integer
* Get port number
GetParam 'PO' Port
* Get baud rate
GetParam 'BA' BaudRate
* Get Zmodem block size
GetParam 'ZB' Block
Set Block = '50'
* Get file spec
GetParam 'FN' FileSpec
* Get host mode flag
GetParam 'HP' HostMode
* Get directory we're in now
GetDir CurDrive CurDir
* If host mode, move to host mode
* download directory and set restrict.
Set Restrict = ''
*
IF ( HostMode <> ' ' ) THEN
*
GetParam 'HD' UpDir
* Strip final '\' if any from download dir
Set L = LENGTH( UpDir )
*
IF ( Substr( UpDir, L, 1 ) = '\' ) THEN
Set UpDir = Substr( UpDir, 1, L - 1 )
ENDIF
* Move to download dir
ChDir UpDir
* Set restrict if not super-user
IF ( HostMode <> 'S' ) THEN
Set Restrict = 'restrict '
ENDIF
*
ENDIF
* Build DSZ invocation line
*
Set Zmodem = CONCAT( 'DSZ port ' , Port )
Set Zmodem = CONCAT( CONCAT( Zmodem , ' speed ' ), BaudRate )
Set Zmodem = CONCAT( CONCAT( Zmodem , ' d z pL' ), Block )
Set Zmodem = CONCAT( CONCAT( CONCAT( Zmodem , Restrict ), ' sz ' ), FileSpec )
*
* Echo built line to screen
Writeln " "
Writeln "Invoking DSZ as follows:"
Writeln Zmodem
Writeln " "
* Echo Zmodem line to capture file
*
Writelog "Invoking DSZ as follows:"
Writelog Zmodem
* Call DSZ
Dos Zmodem
* Return to original directory if host mode
IF ( HostMode <> ' ' ) THEN
Set CurDir = CONCAT( CONCAT( CurDrive , ':\' ), CurDir )
Chdir CurDir
ENDIF