home *** CD-ROM | disk | FTP | other *** search
/ Hall of Fame / HallofFameCDROM.cdr / rbbs / bipatch.lzh / BIPATCH.BAS < prev    next >
BASIC Source File  |  1989-09-23  |  9KB  |  147 lines

  1. ' Copyright (c) 1989, Julie M. Covington
  2. '                     STARWEST-bbs co-sysop
  3. '                     (509)758-6248 (300-1200-2400-bps 8-N-1 First-time access)
  4. '                     (509)758-6245 (Voice)
  5. '                     525 15th Street
  6. '                     Clarkston, Washington, 99403.
  7.  
  8. '    I the author, place this source-code program and comments in the
  9. ' public-domain, to be freely used, copied, modified, compiled, or distributed
  10. ' via electronic computer bulletin-boards or computer user groups for no extra
  11. ' charge with the exception of a nominal media/duplication fee. It cannot be
  12. ' sold outright, or combined with other items in a package for sale without the
  13. ' expressed permission of above specified author. Monetary donations to the
  14. ' above address will go towards work on future upgrades, support and new items.
  15.  
  16. '    I the author, take no responsibility for the effects or side-effects of
  17. ' using, copying, modifying, compiling, or distributing this source-code
  18. ' program and comments.
  19.  
  20. '    In short, use it, pass it around, customize it, have fun. Good luck.
  21.  
  22. '    BIPATCH.EXE is a program which allows Bimodem, the simultaneous upload/
  23. ' download/chat file-transfer protocol, to interface into the RBBS-PC bulletin-
  24. ' board-system environment. RBBS-PC and other bulletin-board-systems adhere
  25. ' to the modern standard of signaling the external file-transfer protocol
  26. ' driver that a batch transfer is to take place by prefixing an @ symbol onto
  27. ' the beginning of the filename to transfer. Example: @C:\RBBS\NODE1WRK. This
  28. ' would indicate to the protocol driver that  file NODE1WRK, located in the
  29. ' \RBBS subdirectory on drive C:, is not a file to send but a file containing
  30. ' a list of files to send.
  31. '    Bimodem, set up as its authors intend, does not recoginize this switch.
  32. ' It usually requires a whole door environment to work, and then circumvents
  33. ' RBBS-PC's extensive security system for time-remaining, security-level, and
  34. ' other built in checking. This is due to non-standard batch-mode operation.
  35. ' Bimodem does accept filenames to be strung-out on its command-line luckily.
  36. ' This program, BIPATCH.BAS, and its compiled form BIPATCH.EXE, convert
  37. ' the file sent by RBBS-PC containing a list of files to be sent in batch mode
  38. ' into a Bimodem command-line listing of files to be sent.
  39. '    BIPATCH.EXE will allow Bimodem to behave in the RBBS-PC environment just
  40. ' exactly as Zmodem or other modern protocol drivers. Stack-up a bunch of files
  41. ' to download in RBBS-PC and away it goes. The available length of the command
  42. ' line is the only limitation.
  43. '    This program was written in Turbo-basic 1.1. Co-processor switch off, DOS
  44. ' break switch off for compiling. Modifications needed to run on a multi-node
  45. ' RBBS-PC system. The source-code for compilation follows:
  46.  
  47.  
  48.  
  49.  
  50.  
  51.     cline$=command$                            ' BIUP.BAT the bimodem send
  52.                                                ' batch-file specified in rbbs
  53.                                                ' PROTO.DEF executes this
  54.                                                ' basic program whose source
  55.                                                ' code you are now reading.
  56.                                                ' Cline$ takes on dos command-
  57.                                                ' line passed to BIUP.BAT from
  58.                                                ' rbbs PROTO.DEF.
  59.  
  60.     bflag%=instr(cline$,"@")                   ' Bflag% takes on position of @
  61.                                                ' symbol within cline$. Rbbs
  62.                                            ' appends @ as first character
  63.                                                ' of filename for protocol to
  64.                                                ' to send if batch-mode. Bflag%
  65.                                                ' returns 0 if @ not found.
  66.  
  67.     if bflag%<1 then outfl$=cline$:goto 100    ' If bflag%=0 then non-batch
  68.                                                ' mode indicated and cline$ is
  69.                                                ' passed unchanged to the new
  70.                                                ' bimodem command line this
  71.                                                ' program will create.
  72.  
  73.     lstfl$=right$(cline$,len(cline$)-bflag%)   ' Lstfl$ takes on the filename
  74.                                                ' rbbs sent to the protocol.
  75.                                                ' Usually C:\RBBS\NODE1WRK which
  76.                                                ' isn't a file to send but
  77.                                                ' contains a list of files to
  78.                                                ' send as a batch transfer.
  79.  
  80.     tem$=left$(cline$,bflag%-1)                ' Tem$ takes the portion of
  81.                                                ' cline$ up to the @ symbol in
  82.                                                ' the filename @C:\RBBS\NODE1WRK
  83.  
  84.     temfl$=""                                  ' Clear temfl$ which will hold
  85.                                                ' the filnames to transfer on
  86.                                                ' bimodem's command-line.
  87.  
  88.     open lstfl$ for input as #1                ' Open the file rbbs sent as
  89.                                                ' the file containing the list
  90.                                                ' of files to batch transfer.
  91.                                                ' Usually C:\RBBS\NODE1WRK.
  92.  
  93.     do until eof(1)                            ' Begin a loop to pull filename
  94.                                                ' records from NODE1WRK and
  95.                                                ' line them up separated by
  96.                                                ' spaces on a dos command line.
  97.  
  98.     line input#1,dtemp$                        ' Dtemp$ takes on filename
  99.                                                ' from a record in NODE1WRK.
  100.  
  101.     temfl$=temfl$+dtemp$+" "                   ' Temfl$ adds the contents of
  102.                                                ' of dtemp$ which is another
  103.                                                ' filename plus a space to its
  104.                                                ' current contents.
  105.  
  106.     loop                                       ' Keep pulling filename records
  107.                                                ' from NODE1WRK and adding them
  108.                                                ' up on one long line separated
  109.                                                ' by spaces.
  110.  
  111.     close #1                                   ' Close the filename contained
  112.                                                ' in lstfl$ usually NODE1WRK
  113.                                                ' which was passed by rbbs
  114.                                                ' in the PROTO.DEF command-line.
  115.  
  116.     outfl$=tem$+temfl$                         ' Outfl$ takes on tem$ which
  117.                                                ' contains most of the original
  118.                                                ' protocol command-line plus
  119.                                                ' temfl$ which contains all the
  120.                                                ' filenames separated by a space
  121.                                                ' to transfer in the batch.
  122.  
  123. 100 open "bifix.bat" for output as #1          ' Open BIFIX.BAT which is going
  124.                                                ' to be the new batch-file that
  125.                                                ' will invoke BIMODEM.COM with
  126.                                                ' all the files in the batch
  127.                                                ' transfer on its command-line.
  128.  
  129.     print #1,outfl$                            ' Write out one single line in
  130.                                                ' the new batch-file BIFIX.BAT
  131.                                                ' which will execute BIMODEM.COM
  132.                                                ' with all needed switches and
  133.                                                ' parameters from the original
  134.                                                ' command-line passed from rbbs
  135.                                                ' PROTO.DEF plus the newly
  136.                                                ' broken-down filenames from
  137.                                                ' NODE1WRK.
  138.  
  139.     close #1                                   ' Close BIFIX.BAT the newly
  140.                                                ' created batch-file in
  141.                                                ' preparation to exit.
  142.  
  143.     end                                        ' Exit this program and return
  144.                                                ' execution control back to
  145.                                                ' the bimodem send batchfile
  146.                                                ' BIUP.BAT which originally
  147.                                                ' called this program.