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