home *** CD-ROM | disk | FTP | other *** search
/ Shareware Overload / ShartewareOverload.cdr / comm / zcm_scrp.zip / UPL.T < prev    next >
Text File  |  1989-11-21  |  4KB  |  122 lines

  1.     :: See comments at end of the file Rev 09-24-89
  2.     open -!tgx %item
  3.     set s1 ""    : flag indicatng Sysop quota exceeded
  4. cloop:    grab s0
  5.     while "t&&!%s0" grab s0
  6.     ss s0 "^(@)(.*)"
  7.     if "t&&%z1" echof "Command Line: %z2"; obey "%z2"; goback cloop
  8.     closetx
  9.     set ifs "     "        : split on space or tab
  10.     split s0
  11.     if "!%z2" goto failed
  12.     if !f%z2 goto nofile
  13.     if !f%z1 goto nofile
  14.     pat
  15.     pat 0cp " ^Q " "\021"
  16.     pat 1v "\nDL "
  17.     pat 6v "\nLIB %z3"
  18.     on !c o; fail
  19.     if az3 put "\025DL%z3\r"    : get to proper DL section
  20.     else put "\025DL0\r"
  21.     wait -f40
  22.     if !1&&!6 goto failed
  23.     wait -f1
  24.  
  25.     set typ "bin"
  26.     if jz0,.doc set typ "ascii"
  27.     if jz0,.txt set typ "ascii"
  28.     if %z4 sets typ %z4
  29.  
  30.     echoc "Enabling c mode"
  31.     ena -c
  32.     put "upl %z0/type:%typ/proto:b\r"
  33.     pat 2cv "Replace it" "y\r"
  34.     pat 1v "File name"
  35.     pat 3v "Please notify the Sy"
  36.     wait -f40
  37.     if 3 set s1 "quota"; goto failed
  38.     if !1 goto failed
  39.     wait -f1
  40.     put "\025\T%z1";  put "\r"
  41.     timestamp
  42.     pat 1v "Description"
  43.     pat 2v "?DO_UPL-ERR"
  44.     wait -f60
  45.     :: CIS uploads the file here (B Protocol)
  46.     echoc "Disabling c mode"
  47.     dis -c
  48.     timestamp
  49.     if 2 goto failed
  50.     if !1 echo "Didn't find pattern 2"; wait -f40
  51.     if 2 goto failed
  52.     if !1 echo "Didn't find pattern 2"; wait -f40
  53.     if 2 goto failed
  54.     wait -f1
  55.     pat 1v "okay"
  56.     pg10; ena -p; pq8; put "\025"
  57.     pat 4c "6 EXIT" "6\r"
  58.     open -g!x %z2
  59.     wait -f40
  60.     ena -t!p
  61.     timestamp
  62.     pv5
  63.     put "\025Y\r"
  64.     pat 5v "soon as"
  65.     wait -f400
  66.     pv0
  67.     timestamp
  68.     if !5 echoc "Timeout (400 seconds!) waiting for completion message.";  goto failed
  69.     obey "!mv %item upl/done"
  70.     goto final
  71. nofile:    echoc "FILE %z0 or %z1 NOT FOUND!!!"
  72. failed:    echoc "Upload (control file %item) failed"
  73.     ena -t!p
  74.     ::obey "!mv %item upl/failed"
  75. final:    nolog closetx
  76.     echoc "upl.t finished"
  77.     pat
  78.     pat 1v "Forum !\b"    :Desired response
  79.     pat 2v "Function: \b"    :Desired response
  80.     put "\r"
  81.     wait -f20
  82.     pe0
  83.     if %s1 fail        : Terminate "expand" if quota problem
  84.     return
  85.  
  86. :: Upload a file to a SIG, assumes we are at the SIG Function: prompt
  87. :: and (hopefully) returns us there.  Gives up on error.
  88. :: This is called by a line such as:
  89.     if %s8 obey "expand upl.t upl/%s8*"
  90. :: and expects to find one line CONTROL FILES such as:
  91.  
  92. disinf.txt $p/disinfo.txt /t/yam/disinf.key 0 ascii
  93.  
  94. :: The control file may have any number of optional leading command lines,
  95. ::    @immediate command(s)
  96.  
  97. :: where the first field is the SIG filename, the second field is the
  98. :: pathname on the YAM system, the third field the pathname for the
  99. :: description/key file, the fourth field is the DL section number.
  100. :: Am optional fifth field gives the upload type (ascii), default bin.
  101. ::
  102. :: The descritpion file contains the description (500 char max), a
  103. :: /exit line, and the keywords (sample below):
  104.  
  105. DSZ is optimized to be called from a bulletin board or other comm
  106. program to support YMODEM and fast ZMODEM file transfers.  This version
  107. has buffered XMIT for greater throughput, esp. with multitasking
  108. executives.  Automatic selection of comm port, baud rate, etc with
  109. override.  Supports 32 bit CRC, wild card xfers, recovery from line
  110. disconnects, etc.  See dsz.dqc and the ZCOMM or Pro-YAM user's manual
  111. for more information, also ZMODEM.DOC. (part of ZMODEM.ARC).
  112. /exit
  113. ZMODEM YMODEM CRC-16 FILE-TRANSFER THROUGHPUT XMODEM CRC-32
  114.  
  115. :: This script assumes the SIG editor has been selected, it will not
  116. :: wotk with the line editor.
  117. ::
  118. :: Upon successful upload, the control file is moved to the "done"
  119. :: subdirectory, or the "failed" subdirectory otherwise.
  120. :: File is uploaded as type bin unless it has an extension of .doc or .txt
  121. :: The optional fifth field (if present) overrides the above choice.
  122.