home *** CD-ROM | disk | FTP | other *** search
/ The Glitch Apple Disk Collection / 2014.glitch.apple.collection.zip / indexed / ARCHIVE.DSK / BINSCII.TXT < prev    next >
Text File  |  2014-09-09  |  11KB  |  182 lines

  1.  
  2. BinSCII is a program for the Apple II series that encodes and decodes Apple
  3. ProDOS files to allow convenient and relatively error free transmission over
  4. email networks. BinSCII is functionally similar to unix' uuencode/uudecode
  5. utilities and Macintosh Bin Hqx (binhex); that is, it allows any local file,
  6. including the file's local attributes, to be transferred via email in a format
  7. that consists entirely of printable text. This allows the file to traverse the
  8. network unscathed, and be perfectly reconstructed on the destination system.
  9.  
  10.  
  11.         What a BinSCII File Looks Like
  12.  
  13. The easiest way to identify a BinSCII encoded file is for the person who
  14. sent it to tell you it's BinSCII. The second easiest is to look for the name
  15. extensions "BSC", "BSQ" (which implies that the encoded file is a Shrinkit
  16. archive), or "BNS" (obsolete, but still used in some parts of the globe).
  17. The hard way is to look for one or more blocks of text that resemble the
  18. following (minus the one tab indent):
  19.  
  20.         FiLeStArTfIlEsTaRt
  21.         ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789()
  22.         HFILENAME       AsU4AAAACA(4nIAg1(BAfcBFXQRtAADAA0gB
  23.         GVvTlzW6B09JAAAAXQBAH4hWAAAAadBFAcgHAIAAAAAAAAAAhDAAAAwSAAAAAAAA
  24.         GVvTUqJ2BAAPAMAABAAAA8CAAAw4AYAAAAAAAAAAAAgAaJRBAcgHFAAAeolEAAwB
  25.         XQBAH4hWAAAAAAAAAAwAAAAAJAAAAAAAAAAIAAAABAAAAAAAAAAAAgMACAAAAIAA
  26.                 [ ... many more lines of similar construction ... ]
  27.         U60b3ZXx6fQLxHknavFB8KEvsqYPEAwJxxHwixYGwGPw9UmP05Zvv19IqxRGlSAI
  28.         (Yi1OKL7CAyfqJFAN)W(Ih7F5JzLrm1Rgx8jG(e2dcOgvc(6mvpw))6mopP6h85D
  29.         erpz7nNjyY2pI8OIbAGCHiPA4kAAiIAwKAI8DACNAIwPAAAAAAAAAAAAAAAAAAAA
  30.         AsIR
  31.  
  32. The main menu of BinSCII 1.0.3 refers to any file containing such a block as
  33. 'TXT'. The filename prompts use the term 'text file'. In both cases, they
  34. denote a ProDOS file which is assumed to contain any number of the above
  35. blocks, optionally interspersed with arbitrary amounts of non-block
  36. information (usually things like mail and news headers, and messages from the
  37. sender describing the contents).
  38.  
  39.  
  40.         Getting Started with BinSCII, in Three Easy Steps
  41.  
  42. 1.      Download the file BINSCII.EXE. (If you are receiving it as part of
  43. another file, edit the file so that the first and last lines begin with REM.
  44. Delete anything before the first REM and anything after the last REM. Save the
  45. result as 'text only', or print to disk, or whatever; the idea is to get a
  46. simple ASCII text file with no special formatting information. Step two below
  47. assumes that you named this file BINSCII.EXE, which is just an arbitrary name
  48. that I chose. Make sure there isn't already a file named BINSCII in that
  49. directory -- especially not the text file itself -- because the decoding
  50. process will fail if there is.)
  51.  
  52. 2.      EXEC the resulting text file from BASIC.SYSTEM (otherwise known as
  53. AppleSoft BASIC, or the ']' prompt under ProDOS) by typing EXEC BINSCII.EXE
  54. and watch the nifty lo-res thermometer bar. The decoding process will take a
  55. few minutes, and when it is finished a SYS file named BINSCII will have been
  56. created in the current directory. You should see two large numbers when it is
  57. finished, and they should match exactly. If they don't, something went wrong
  58. along the way (either in transit or in editing) and the BINSCII file will not
  59. be reliable, so I'd advise against running it (in other words, don't push your
  60. luck). You may also see a ?SYNTAX ERROR or two after the numbers; this is just
  61. AppleSoft burping on extra blank lines at the end of the text file and, while
  62. it may be disconcerting, it is nothing to worry about.
  63.  
  64. 3.      BinSCII is a SYS file just like AppleWorks or Basic.System, and you can
  65. run it from the GS/OS Finder, a ProDOS 8 program selector, the basic dash
  66. command (type -BINSCII from the ']'), or whatever method you prefer. This will
  67. bring up BinSCII's main menu; just follow the menus and prompts and you're all
  68. set. (Well, not quite; see below for some helpful hints about BinSCII 1.0.3.)
  69.  
  70.  
  71.         For the Curious: About the Appended EXEC File
  72.  
  73. This exec file was developed by me during the summer of 1990, in an attempt to
  74. get BinSCII to a guy whose download environment broke Executioner. (Prior to
  75. that, I sent out self-extracting files created by Glen Bredon's Executioner
  76. program.) Executioner is much faster than this EXEC file, but it cannot deal
  77. with extra white space that might slip in during transmission or editing, and
  78. its method of encoding is less space-efficient. (The Executioner BinSCII is
  79. roughly 200% the size of the original, whereas this EXEC file is about 133%
  80. larger.)
  81.  
  82. The encoding scheme I use is similar to BinSCII, but is implemented entirely
  83. in AppleSoft (that's why it's so slow). I made it to be rugged; in fact, it is
  84. far more forgiving of text file mishaps than Executioner. You will notice the
  85. difference if you use AppleWorks 2.0 to edit the file, because 2.0 adds spaces
  86. into the main data section and this file reads right through them. Executioner
  87. (and BinSCII 1.0.3, by the way) do not.
  88.  
  89. How it works: when you type EXEC BINSCII.EXE, Basic.System (the ProDOS part of
  90. the BASIC environment) opens up BINSCII.EXE and uses it as 'phantom keyboard'
  91. input to AppleSoft -- that is, it makes AppleSoft think that you typed in the
  92. contents of the file, really fast and without any typos. If you edited the
  93. file according to instructions, the first thing AppleSoft sees will be the REM
  94. line, which it will ignore. Next comes a NEW, a short AppleSoft program, and a
  95. RUN. The AppleSoft program does the real work, and uses GET to read the actual
  96. data from the rest of the file; I'll leave deciphering the program itself as
  97. an exercise for the reader. Since it uses the same basic process as BinSCII,
  98. you will gain some insight into how BinSCII works by the time you are
  99. finished. BinSCII, however, uses a far more sophisticated integrity check, and
  100. can split files up into more than one text block (and successfully recreate
  101. the original file from the pieces). BinSCII is also much faster.
  102.  
  103.  
  104.         Important Caveats: BinSCII 1.0.3 and Various Quirks Thereof
  105.  
  106. BinSCII 1.0.3 is fairly easy to operate, but its interface is admittedly
  107. archaic (work is progressing on a replacement, but not as fast as I'd like).
  108. Here are some tips and clarifications on exactly what BinSCII does and how
  109. to make it do your bidding without a lot of fuss.
  110.  
  111. 1.      When BinSCII asks you for a filename, it is a good idea to enter the
  112. complete name, directories and all. (Example: /DATA/DOWNLOADS/SHRINKIT.BSQ)
  113. The reason for this is that every time BinSCII asks you for a prefix to store
  114. files in, it sets the current directory there. (BinSCII does the equivalent of
  115. a PREFIX command with the directory you specified.) If you then do something
  116. else with another file, that prefix will still be in effect, and the filenames
  117. you give BinSCII will have to take that into account. The safest way to avoid
  118. all that is to always enter the complete name.
  119.  
  120. 2.      How the Unconvert option works: BinSCII searches the text file for a
  121. 'FiLeStArTfIlEsTaRt' line, and then decodes a block (which contains at most a
  122. 12K piece of the ProDOS file). It repeats this process until it reaches the
  123. end of the file (or an error occurs). This means that you can take all the
  124. BinSCII files you have and concatenate them into one big file, and (assuming
  125. you have the disk space for that file and its decoded counterparts) run the
  126. file through BinSCII all at once -- BinSCII will put each block where it
  127. belongs. You can just go away, grab a drink and a donut, and come back when it
  128. is finished. Be warned, however, that BinSCII 1.0.3 does not account for extra
  129. white space inside the text blocks; this is usually not a problem but it has
  130. been known to cause BinSCII to abort processing of a file that is otherwise
  131. intact. In the middle of a very long file, this can be rather annoying when it
  132. happens.
  133.  
  134. 3.      The flip side to #2 is that BinSCII also does not need to see complete
  135. files in every input. You can decode part 1 today, and part 2 tomorrow, and
  136. part three next week if you want. As long as you decode the parts into the
  137. same directory, and don't touch the output file until you've decoded all the
  138. parts, then everything works. This is a feature unique to BinSCII and is not
  139. possible with similar formats on other platforms. For it to work, though, the
  140. output file name MUST be both correct and unique within the destination
  141. directory or BinSCII will mangle the output file. (See #4 below.)
  142.  
  143. 4.      BinSCII does not check before overwriting files while it is decoding;
  144. if you are decoding a file and there is already a different file with the same
  145. name in the destination directory, BinSCII will happily trample it thinking it
  146. contains previously decoded pieces of the file it is decoding. The same
  147. applies for concatenated input files (see #2 above): if two files with the
  148. same name are found in the same input, BinSCII will assume that they are
  149. indeed the same file, even if they conflict, and will mix them together to
  150. produce a completely unusable output file. This almost _never_ happens, but
  151. the potential for danger does exist.
  152.  
  153. 5.      When you encode files with BinSCII, it asks if you want to use CR or
  154. LF. All this does is determine the newline (return) character that separates
  155. every line of text. All Apple and Mac programs expect CR (the return key or
  156. Control-M), but unix programs expect LF (Control-J or down-arrow). If you are
  157. using text transfer to the other system, use CR because the transfer program
  158. (usually Kermit or X/Y/Z-MODEM) will take care of any necessary conversions.
  159. (Binary transfer to a unix system is the main case in which you'd want to
  160. use LF.) In general, unless you are doing binary transfer to a PC clone or an
  161. EBCDIC mainframe, one of those two options has to work. If you look at the
  162. file on the other system and it prints all on a single line (CR's on an LF
  163. system), or it prints in a barber pole style pattern (LF's on a CR system),
  164. or it prints with no line breaks at all and fills the screen (this might
  165. happen on a really foreign system) then using the other option will almost
  166. definitely fix things.
  167.  
  168. 6.      BinSCII files are produced by encoding each 12K (or less) chunk of the
  169. file and outputting the result to a file in the destination directory whose
  170. name is formed by adding a .01, .02, .03, ..., to the original filename. (If
  171. the combined length is too long for ProDOS then it will lose the last few
  172. characters of the original filename to make things fit.) These names are just
  173. to keep everything organized and you can do whatever you want to them.
  174.  
  175. Send any comments, questions, flames, etc. to
  176. Todd Whitesel
  177. Internet: toddpw @ cco.caltech.edu
  178. GEnie: A2PRO.TODDPW
  179.  
  180. This file is in the public domain. I place no limits on its distribution.
  181.  
  182.