; 6 aug 85 esj add support for @filename ; 23 jly 85 esj fixing filename problems * 19-Jul-85 LEC; tpl conversion, first pass ;;;;;; SSEND ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; E:F A:S (NWLS,STKARG) E'O SSEND. ; setting up remote line and directory file before calling SENDSW /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERCOM /INCLUDE BYU.PROG.KERMIT.SYM.EQU.KERDEF G:L CHAR G:L TPNAME(*) G'L IFD(*) ; file descriptor for file containing a list of ; files to be sent G'L IFDFLG ; yes = file names from ifd file/ no = only 1 file I'R STATUS I'R X,BELL BELL=7 ; test for empty line E:E NXTCHAR.(1) W'R CHAR .E. 0 E:E TYPEMSG.($Proper format is "SEND [@]FILENAME"!$) T'O BADOUT E'L ; restore the last char if not at eol E'E PREVCHAR.(1) W'R CHAR .E. $@$ ; get the file name to send from our source file IFDFLG = YES ; trash the @ char before getting the filename E:E NXTCHAR.(1) E:E FMNAME.(TPNAME) STATUS = OPENTEXT.(TPNAME,$RD$, $CV$, IFD) W'R (STATUS.NE.0) ;file exist ?? E'E TYPOUT.(TPNAME-1,TPNAME(1)) E:E TYPEMSG.($ <--- Indirection source file does not exist!$) E'E CLOSTEXT.(IFD) T'O BADOUT O'E ; get the first file to read E'E NEXTFILE.(IFD, TPNAME) W'R TPNAME .E. 0, T'O BADOUT E'L O'E ; get the only file to read IFDFLG = NO E:E FMNAME.(TPNAME) E'L STATUS = OPENTEXT.(TPNAME,$RD$, $CV$, FD) W'R (STATUS.NE.0) ;file exist ?? E'E TYPOUT.(TPNAME-1,TPNAME(1)) E:E TYPEMSG.($ <--- Source file does not exist!$) E'E CLOSTEXT.(FD) O'E ; convert filename to kermit type string, being careful to not ; include the ! terminator E'E CHTOIN.(TPNAME(1), FILNAME, TPNAME-1) W'R (HOSTON.EQ.YES) ;we are running in Host mode E'E TYPE.(0,0) E'E TYPMSG.($File OK, Waiting !$) E'E TYPEINT.(DELAY) E'E TYPEMSG.($ seconds!$) E'E XDELAY.(DELAY) STATUS=SENDSW.(X) ;send the requested file O'E STATUS=SENDSW.(X) ;send the request fi E'L E'E TYPE.(0,0) W'R (STATUS.EQ.YES) E:E TYPEMSG.($file transfer COMPLETED!$) O'E E:E TYPEMSG.($file transfer FAILED!$) E'L E'L E'E CLOSTEXT.(FD) BADOUT C'E F'N E'N