home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1993 #1 / NN_1993_1.iso / spool / comp / sys / mac / programm / 21335 < prev    next >
Encoding:
Text File  |  1993-01-12  |  3.4 KB  |  74 lines

  1. Newsgroups: comp.sys.mac.programmer
  2. Path: sparky!uunet!munnari.oz.au!uniwa!cujo!ncrpda.curtin.edu.au!rocky.curtin.edu.au!user
  3. From: peter@cujo.curtin.edu.au (Peter N Lewis)
  4. Subject: Re: Why does BinHex exist? (my mistake)
  5. Message-ID: <peter-130193092457@rocky.curtin.edu.au>
  6. Followup-To: comp.sys.mac.programmer
  7. Lines: 60
  8. Sender: news@ncrpda.curtin.edu.au
  9. Nntp-Posting-Host: ncrpda.curtin.edu.au
  10. Organization: NCRPDA, Curtin University
  11. References: <2965@tau-ceti.isc-br.com> <C0JD83.DMz@news.cso.uiuc.edu> <NEERI.93Jan12113717@iis.ethz.ch>
  12. Date: Wed, 13 Jan 1993 01:34:08 GMT
  13.  
  14. In article <NEERI.93Jan12113717@iis.ethz.ch>, neeri@iis.ethz.ch (Matthias
  15. Neeracher) wrote:
  16. > In article <1993Jan8.180438.9696@netcom.com>, howard@netcom.com (Howard Berkey) writes:
  17. > > I should have made it clear that I know what binhex actually does.  
  18. > > My mistake was in assuming that everyone would be able to 
  19. > > have access to uuencode, which does substantially what binhex does
  20. > > (i.e. convert a binary file to 7-bit (6 for binhex but the same
  21. > > principle)) so it can be mailed/cross EBCDIC gateways/etc.).
  22. > BinHex preserves file types and both forks of a file, while uuencode
  23. > doesn't. Otherwise, they are pretty similiar (And no, I don't think
  24. > uuencode uses 7 bits, it creates files that are bigger than BinHex files).
  25. > So even if everybody had access to uuencode, I don't see a particularly good
  26. > reason to use it.
  27.  
  28. UUencode uses 6-bit encodings, the same size as BinHex.  UU uses a very
  29. simple encoding scheme (the 6 bit value is added to <space> (32)) as
  30. opposed to a table lookup for BinHex.  UU also 'wastes' an extra byte per
  31. line (62 characters) with a line length, and BinHex has a run length
  32. encoding field (although most encoders don't support it, so this feature
  33. actually marginally increases the size).  Basically, a BinHex and uuencoded
  34. file of the same original file should be roughly the same size.
  35.  
  36. As a test, a 30k text fil with no repeats in it (and no RLE ($90) codes in
  37. it to muck BinHex around) gives:
  38.  
  39. Original 30720
  40. BinHex 41689 (136%)
  41. uuencode 42350 (138%)
  42.  
  43. Note1: The difference between the two is 661 bytes, the uuencoded file has
  44. 686 lines, hence 686 extra line length bytes making up the difference
  45. between the two almost exactly.
  46.  
  47. Note2: For a binary file (eg a compressed file), the run length encoding
  48. miight add half a percent to the BinHex length if it wasn't implemented,
  49. and might marginally reduce the size if it was.
  50.  
  51. > My preferred solution would be to store files in MacBinary on servers, but
  52. > make the ftp daemon translate files to BinHex if requested (Peter Lewis' ftpd
  53. > does this, if I remember correctly).
  54.  
  55. Actually, FTPd stores the files on the Mac in native format, and
  56. automagically converts them on request for file.bin or file.hqx into
  57. MacBinary or BinHex.
  58.  
  59. As for unix servers, although BinHex is not as efficient as MacBinary, I
  60. wouldn't be suprised in the least if converting all the files to MacBinary
  61. didn't increase network traffic as all the newbies download the MacBinary
  62. files in ascii mode a few times before figuring out about binary mode.
  63.  
  64. Personally, I like BinHex cuz it almost always works no matter what you do.
  65.  The only time I use MacBinary is for large files and slow links when I
  66. have to wait for the file to come thru.
  67.    Peter.
  68.  
  69. _______________________________________________________________________
  70. Peter N Lewis <peter@cujo.curtin.edu.au>             Ph: +61 9 368 2055
  71.