home *** CD-ROM | disk | FTP | other *** search
/ ProfitPress Mega CDROM2 …eeware (MSDOS)(1992)(Eng) / ProfitPress-MegaCDROM2.B6I / BBS / MISC / SCRIPTS.ZIP / UPL.T < prev    next >
Encoding:
Text File  |  1991-10-07  |  3.8 KB  |  125 lines

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