home *** CD-ROM | disk | FTP | other *** search
/ ftp.barnyard.co.uk / 2015.02.ftp.barnyard.co.uk.tar / ftp.barnyard.co.uk / cpm / walnut-creek-CDROM / CPM / STARTKIT / COMPRESS.TXT < prev    next >
Text File  |  2000-06-30  |  12KB  |  249 lines

  1.                       How to Use File Compression
  2.                               Rick Weerts
  3.  
  4. Fred, a novice modem user, heads towards the download section of his
  5. favorite Bulletin Board System.  He pulls off about four files and logs
  6. off an hour later.
  7.  
  8. Fred then attempts to execute the programs, expecting marvelous things
  9. on his microcomputer.   But no matter what he does or who he calls, the
  10. files he received refused to work.
  11.  
  12. Fred is the victim of file compression.  Numerous utilities exist today
  13. which allow the modem user to compress a file before transmission to a
  14. board or another user.  This compression saves on users' time and phone
  15. bills, and the BBS itself receives more room for download files.
  16. Nevertheless, unless the files are converted properly after they are
  17. downloaded, they are useless, as the computer cannot read them.  This
  18. article attempts to cut through some of the fog regarding file
  19. compression and its effects on the bulletin board community...
  20.  
  21.                               The Concept
  22.                               -----------
  23.  
  24. Most files on a bulletin board (and most others on microcomputers in
  25. general) make use of a lot of text (alphabetic) information.  This
  26. information (when stored in a standard format known as ASCII) can be
  27. analyzed by virtually any other computer system operating today.
  28. However, with the invention of 8 bit protocols that are used for most
  29. telecommunications, this storage format is wasteful.  It is also much
  30. more expensive when telephone usage is paid for by the hour.
  31.  
  32. Before I go on, it is important to explain the bit protocols and the
  33. information they attempt to represent.  As most people know, each piece
  34. of information in a computer is coded with a series of 1's and 0's.  The
  35. computer can act and interpret on these codes.  A combination of seven
  36. 1's and 0's is called a 7 bit protocol (one bit for each number in the
  37. combination).  This protocol makes use of the ASCII character standards.
  38. For you math wizards out there, the combination of seven binary bits of
  39. 1's and 0's allows for 128 numeric combinations.  Each number in the 128
  40. numeric combinations stands for a specific alphanumeric code.  These
  41. codes much up the ASCII table and include all alphabetic and some
  42. special characters the computer generates.  The numeric representation
  43. of characters is what the computer deals in, not the characters
  44. themselves.
  45.  
  46. However, my IBM can generate 256 CHR$(x) codes!  And I just said there
  47. were only 128?
  48.  
  49. IBM and most other modern computer makers have also included a 8th
  50. (high) bit in the character codes for their system.  This additional bit
  51. adds another 128 possible combinations (1+2+4+8+16+32+64+128) to the
  52. previous 128 on the original ASCII table.  The additional 128 numerals
  53. can represent additional symbols or even block graphic characters.
  54.  
  55. I am not going to get into the specifics on bit protocols.  The idea
  56. behind file compression (squeezing, compressing, crunching, whatever you
  57. want to call it) is to make use of these extra 128 characters that are
  58. used less than the first 128.  These extra characters can stand for
  59. twelve spaces, sixteen hyphens, or whatever else the compression
  60. software allows.  This coding allows more information to be included in
  61. the same amount of space.  Since the computer is using all 256
  62. characters in such an environment, you must transmit using the 8 bit
  63. modem protocol (8-N-1, referring to eight bits, no parity, and one stop
  64. bit).
  65.  
  66.                          Putting it into Action
  67.                          ----------------------
  68.  
  69. When a file is compressed, it passes through a utility program and the
  70. "white space" is deleted from the source document, resulting in a
  71. compact file.  In some cases, this space savings can be more than 50% of
  72. the previous file size.  However, the file is now in a format that the
  73. computer cannot read "stand-alone".  It requires special software to
  74. interpret how to unsqueeze the file into standard storage specs.  In
  75. addition, the file may be stored in a library or archive before or after
  76. it is compressed.  The file is stored together with other files under
  77. one single filename on the disk.  This process can then be reversed by
  78. the end user.  The time savings involved in this clever process becomes
  79. readily apparent.  Compare the time it takes to download one 200K file
  80. versus twenty 10K files, each with it's own distinct filename.
  81.  
  82.                             File Extensions
  83.                             ---------------
  84.  
  85. Most disk files have an eight letter name and a three letter extension
  86. (separated by a period or slash). Often, the extension indicates what
  87. method of compressing or archiving was used.  Below are some common file
  88. extensions BBSs and archiving software uses to denote files which use
  89. packing techniques.
  90.  
  91. File Name                                      Packing Method
  92. =============================================================
  93. FIREFLY.EXE   Original File                    None
  94. FIREFLY.EQE                                    Squeeze (SQ)
  95. FIREFLY.LBR                                    Library (LU)
  96. FIREFLY.LQR                                    (SQ), (LU)
  97. FIREFLY.ARC                                    Archive (ARC)
  98.  
  99. FIDONWS.DOC   Original Text File               None
  100. FIDONWS.DQC                                    Squeeze (SQ)
  101. FIDONWS.LBR                                    Library (LU)
  102. FIDONWS.LQR                                    (SQ), (LU)
  103. FIDONWS.ARC                                    Archive (ARC)
  104.  
  105. BOOMERS.BAS   Original BASIC Program           Binary
  106. BOOMERS.BQS                                    Squeeze (SQ)
  107. BOOMERS.LBR                                    Library (LU)
  108. BOOMERS.LQR                                    (SQ), (LU)
  109. BOOMERS.ARC                                    Archive (ARC)
  110.  
  111.                          Squeeze and Unsqueeze
  112.                          ---------------------
  113.  
  114. SQ and SQPC are two of the first available software packages designed to
  115. compress files into the smallest possible form.  AUSQ, UNSQ, and NUSQ
  116. are their counterparts.  They put files back into expanded format on
  117. request.  Squeezed files usually have a Q as the second letter of their
  118. three-letter file name extension.  Simply typing AUSQ or SQPC alone on a
  119. command line at the DOS level brings up a small help screen that shows
  120. how to operate the system.  Since there are many such programs on the
  121. market, my object is to explain the concept behind them, not how a
  122. specific package operates.  Nevertheless, the documentation on these
  123. packages is usually enough to operate it successfully.
  124.  
  125.                             The Data LIBRARY
  126.                             ----------------
  127.  
  128. LU.EXE is the original library (LBR) utility.  It allows the packing
  129. (and unpacking) of files into one large file.  LUed files usually have a
  130. LBR file extension.  In the same respect, a LQR extension indicates that
  131. the file must be unsqueezed (using AUSQ or NUSQ) BEFORE it is converted
  132. with the library utility.  Also, libraries may consist of one or more
  133. libraries residing inside of each other, some squeezed beforehand.  As
  134. you can see, the standards for the file extensions are important to
  135. follow when dealing with such a variety of systems.
  136.  
  137. Usually, typing LU will give a brief command line summary of the
  138. function.  The library utility usually provides a command which will
  139. remove all the files from the library file to stand-alone files.  The
  140. LBR file will then serve as a compressed backup of the information you
  141. have unpacked.
  142.  
  143. It is usually handy to unpack a library by putting it in its own
  144. subdirectory (DOS MKDIR Command).  In this way, it becomes clearly
  145. evident which files have been removed from the library.  You will not
  146. get them confused with other files with similar or identical names.  You
  147. can then move the files (DOS COPY Command) outside of the subdirectory
  148. or onto the disk of your choosing.
  149.  
  150.                            Archiving Systems
  151.                            -----------------
  152.  
  153. Finally, we come to ARC.EXE, short for Archive.  This handy little
  154. utility takes all the guesswork out of squeezing and packing files into
  155. an archive (or library).  ARC automatically decides the best way to
  156. compress a file and then adds it to the archive.  ARC also unpacks the
  157. file in the same way, eliminating the squeeze step of the process.  The
  158. archive utility is compact and it makes the other packing schemes
  159. obsolete.  Of course, if you have only one file to pack, you may only
  160. want to squeeze it.  In this case AUSQ comes into play.
  161.  
  162. Typing ARC at the DOS command line prompt causes the program to supply
  163. you with an informative help screen.  To unpack all the files from an
  164. archive, you type ARC E archive_name.  Addition of files to an archive
  165. is just as simple.
  166.  
  167. Once a file has been archived, there is no need for further squeezing.
  168. The file has been squeezed as tightly as possible and any further
  169. attempts at compression will only add to the file's size.  Files with
  170. the file name extension .ARC are archive files.
  171.  
  172. The instructions about putting the archive data files in separate
  173. directories still stands.  This technique certainly makes for a much
  174. easier time of packing and unpacking.
  175.  
  176.                        What All This Means to Me
  177.                        -------------------------
  178.  
  179. Archiving and squeezing are not requirements (in most cases) before a
  180. file before is transmitted to a bulletin board.  However, most BBS
  181. system operators will ARC or squeeze the files they receive from users.
  182. Compressing the files ahead of time saves time for the sysop and also
  183. allows more room on the BBS for additional download files, good for
  184. everyone involved.  Also, a sysop of a Commodore board, for example,
  185. will probably not have the capability to squeeze files intended for IBM
  186. systems.
  187.  
  188. Compressing files is also a good idea from the KISS (Keep It Simple,
  189. Stupid!) concept of file transfer.  All the files necessary for a
  190. software system to run should be placed under one archive name.  The
  191. users of the BBS are much more likely to get a working system than if
  192. they have to sift through 500 files until they find all the correct ones
  193. for that particular system.  It also allows for easy updates when you
  194. improve the software.  Archiving makes sure there is only one filename
  195. to delete and one to add.
  196.  
  197. Finally, compressing files SAVES MONEY! Compressed files can be shrunk
  198. more than 50%, cutting AT&T's share of a long distance call in half.
  199. They are also convenient for pay services such as CompuServe or The
  200. Source, where they make sure every second costs.  And it saves money in
  201. both directions, as both the sender and receivers benefit from lower
  202. bills.
  203.  
  204. So the next time you send a file to your favorite BBS, do everyone a
  205. favor and do a squeeze play on Ma Bell.
  206.  
  207.                     Other Confusing Items
  208.                     ---------------------
  209.  
  210. After writing this piece, I noticed that I fluttered for one verb usage
  211. to another with uncanny regularity.  So below is a list of terms and
  212. their (my) definitions.
  213.  
  214. Archive          File(s) that are squeezed and lumped under a
  215.                  single heading by the ARC.EXE package.
  216.  
  217. ASCII            Seven bit protocol standard agreed upon by
  218.                  all major microcomputer manufacturers.
  219.  
  220. Compress         To make a file smaller by shrinking the
  221.                  space the file occupies.
  222.  
  223. Crunch           Same as compress.
  224.  
  225. Library          File(s) lumped under a single heading by
  226.                  LU.EXE or a similar package.
  227.  
  228. Pack             Placing numerous files under a single
  229.                  heading by either the ARC or LU utilities.
  230.  
  231. Protocol         Code of 1's and 0's indicating
  232.                  characters stored in a computer's
  233.                  memory.
  234.  
  235. Squeeze          Same as compress.
  236.  
  237. Unpack           Remove from library or archive one or more
  238.                  sections into stand-alone files.
  239.  
  240. Unsqueeze        Return file to original structure
  241.  
  242. I hope you will find the above article helpful.  If you have any
  243. questions, comments, additions, corrections, gripes, etc., please send
  244. them to me.  I will make an attempt to respond as soon as possible.  Try
  245. to leave a Fido, GEnie or CompuServe address.
  246.  
  247.         December 4, 1985
  248.         Rick Weerts
  249.