On Tue, 11 Mar 2003, Rob Hudson wrote:
> Whenever someone sends me a file from the mac, it appears garbled. An
> example header looks like this:
>
> (This file must be converted with BinHex 4.0)
>
> :$%KPE(!JBQ&N,R4iG!"849K8C'pcB3!!!!!X)3!!!!$M+ca)9%e-2Jd+2%K&383
> q$3Sm9%P86%8q5'9XF$`[9%P86%8q$3Sm6%P15b"548`p)[EMAIL PROTECTED])'K
> [EMAIL PROTECTED])Q0cFbpcG(PXCA-ZBh0c)L"dHA"P25*dCAKd,f0cFb)q$3SmE'PZDb"[EMAIL
> PROTECTED]
> ...
>
> Is there a way to un-binhex this on Linux?
PYTHON is your friend; platfom independent, basically just two lines of
code:
~~~~~~~~~~~~~~~~~~~~~~~~~
from binhex import hexbin
hexbin('inName', 'outName')
~~~~~~~~~~~~~~~~~~~~~~~~~
Or you could also run it on the fly via command line........... Horst
python -c 'from binhex import hexbin; hexbin("inName","outName")'
FROM THE DOCS:
#################################################
12.14 binhex -- Encode and decode binhex4 files
This module encodes and decodes files in binhex4 format, a format allowing
representation of Macintosh files in ASCII. On the Macintosh, both forks
of a file and the finder information are encoded (or decoded), on other
platforms only the data fork is handled.
The binhex module defines the following functions:
binhex(input, output)
Convert a binary file with filename input to binhex file output. The
output parameter can either be a filename or a file-like object (any
object supporting a write() and close() method).
hexbin(input[, output])
Decode a binhex file input. input may be a filename or a file-like object
supporting read() and close() methods. The resulting file is written to a
file named output, unless the argument is omitted in which case the output
filename is read from the binhex file.
#################################################
_______________________________________________
Eug-LUG mailing list
[EMAIL PROTECTED]
http://mailman.efn.org/cgi-bin/listinfo/eug-lug