blob: af49f8c469c3baf98535c52b629b17144d680029 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{binhex} ---
Fred Drakebbac4321999-02-20 00:14:17 +00002 Encode and decode binhex4 files}
Fred Drakeb91e9341998-07-23 17:59:49 +00003
Fred Drakebbac4321999-02-20 00:14:17 +00004\declaremodule{standard}{binhex}
Fred Drakeb91e9341998-07-23 17:59:49 +00005\modulesynopsis{Encode and decode files in binhex4 format.}
6
Fred Drake1aabe5e1998-02-19 18:29:18 +00007
8This module encodes and decodes files in binhex4 format, a format
Fred Drakec37b65e2001-11-28 07:26:15 +00009allowing representation of Macintosh files in \ASCII. On the Macintosh,
Fred Drake1aabe5e1998-02-19 18:29:18 +000010both forks of a file and the finder information are encoded (or
11decoded), on other platforms only the data fork is handled.
12
Fred Drakefc576191998-04-04 07:15:02 +000013The \module{binhex} module defines the following functions:
Fred Drake1aabe5e1998-02-19 18:29:18 +000014
Fred Drakecce10901998-03-17 06:33:25 +000015\begin{funcdesc}{binhex}{input, output}
Fred Drake1aabe5e1998-02-19 18:29:18 +000016Convert a binary file with filename \var{input} to binhex file
17\var{output}. The \var{output} parameter can either be a filename or a
Fred Drake26f7cfe91999-04-23 15:41:53 +000018file-like object (any object supporting a \method{write()} and
19\method{close()} method).
Fred Drake1aabe5e1998-02-19 18:29:18 +000020\end{funcdesc}
21
Fred Drakecce10901998-03-17 06:33:25 +000022\begin{funcdesc}{hexbin}{input\optional{, output}}
Fred Drake1aabe5e1998-02-19 18:29:18 +000023Decode a binhex file \var{input}. \var{input} may be a filename or a
Fred Drake26f7cfe91999-04-23 15:41:53 +000024file-like object supporting \method{read()} and \method{close()} methods.
Fred Drake1aabe5e1998-02-19 18:29:18 +000025The resulting file is written to a file named \var{output}, unless the
Fred Drake26f7cfe91999-04-23 15:41:53 +000026argument is omitted in which case the output filename is read from the
Fred Drake1aabe5e1998-02-19 18:29:18 +000027binhex file.
28\end{funcdesc}
29
Fred Drake26f7cfe91999-04-23 15:41:53 +000030
31\begin{seealso}
Fred Drakeba0a9892000-10-18 17:43:06 +000032 \seemodule{binascii}{Support module containing \ASCII-to-binary
33 and binary-to-\ASCII{} conversions.}
Fred Drake26f7cfe91999-04-23 15:41:53 +000034\end{seealso}
35
36
Fred Drakebbac4321999-02-20 00:14:17 +000037\subsection{Notes \label{binhex-notes}}
38
Fred Drake1aabe5e1998-02-19 18:29:18 +000039There is an alternative, more powerful interface to the coder and
40decoder, see the source for details.
41
42If you code or decode textfiles on non-Macintosh platforms they will
Fred Drakefc576191998-04-04 07:15:02 +000043still use the Macintosh newline convention (carriage-return as end of
Fred Drake1aabe5e1998-02-19 18:29:18 +000044line).
45
Fred Drakefc576191998-04-04 07:15:02 +000046As of this writing, \function{hexbin()} appears to not work in all
47cases.