Xbin is a port of the ancient Un*x tool for extracting BinHex files, based on source originally written by Dave Johnson, Brown University Computer Science.
This version is BeOS "friendly", setting the resource and filetype attributes in a fashion compliant with the HFS file system add-on.  That is to say, mimetypes containing usually upper-case letters.  No, this is not a good thing, but until the HFS add-on changes, it's the "right" thing.

What is BinHex?  BinHex is an encoding scheme, now a file format, similar to uuencoding or base64.  It's a plain text format, in 7-bit ASCII, but unlike uuencoding, it stores a Macintosh file's resource and data forks and Finder flags.  Some downloadable files are made available in BinHex (.hqx) format, thus the possible need for this utility.

Usage:

Put the appropriate version of xbin in /boot/home/config/bin/.

xbin [-v] [-l] [-n name] [-] filename
	-v	Verbose
	-l	List contents
	-n	extract to the specified filename rather than the encoded name
	-	read from standard input

To use with Expander, add the following rule to /boot/home/config/etc/expander.rules
(If you don't have such a file, copy expander.rules.sample, then chmod u+w expander.rules so that it's editable.)

"application/mac-binhex40"		.hqx       "xbin -l %s"        "xbin -v %s"		


Finally, launch the FileTypes preference app, and change the preferred application for both application/Macintosh Binhex Files to Expander.  If you don't have such a mime type, you'll need to create it one as "application/mac-binhex40". You'll probably also want to open Expander with Filetypes and add both application/Macintosh Binhex Files to its list of openable types.

Caveats - for files that you intend to use with MacOS, it's probably a good idea to extract them using MacOS.  I'm not aware of all the auto-mapping of mimetypes done by the HFS add-on, and so probably don't reverse map all of them.  If you find bugs, feel free to let me know, or to fix them.  Source is included.

Scott Lindsey <wombat@gobe.com>
