blob: aae5074a47787cee16bc57ab9bdf1c8c22265faa [file] [log] [blame]
Fred Drake1aabe5e1998-02-19 18:29:18 +00001\section{Standard Module \sectcode{binhex}}
2\label{module-binhex}
3\stmodindex{binhex}
4
5This module encodes and decodes files in binhex4 format, a format
6allowing representation of Macintosh files in ASCII. On the macintosh,
7both forks of a file and the finder information are encoded (or
8decoded), on other platforms only the data fork is handled.
9
10The \code{binhex} module defines the following functions:
11
12\setindexsubitem{(in module binhex)}
13
14\begin{funcdesc}{binhex}{input\, output}
15Convert a binary file with filename \var{input} to binhex file
16\var{output}. The \var{output} parameter can either be a filename or a
17file-like object (any object supporting a \var{write} and \var{close}
18method).
19\end{funcdesc}
20
21\begin{funcdesc}{hexbin}{input\optional{\, output}}
22Decode a binhex file \var{input}. \var{input} may be a filename or a
23file-like object supporting \var{read} and \var{close} methods.
24The resulting file is written to a file named \var{output}, unless the
25argument is empty in which case the output filename is read from the
26binhex file.
27\end{funcdesc}
28
29\subsection{Notes}
30There is an alternative, more powerful interface to the coder and
31decoder, see the source for details.
32
33If you code or decode textfiles on non-Macintosh platforms they will
34still use the macintosh newline convention (carriage-return as end of
35line).
36
37As of this writing, \var{hexbin} appears to not work in all cases.