source: vendor/python/2.5/Doc/lib/libbinhex.tex

Last change on this file was 3225, checked in by bird, 18 years ago

Python 2.5

File size: 1.9 KB
Line 
1\section{\module{binhex} ---
2 Encode and decode binhex4 files}
3
4\declaremodule{standard}{binhex}
5\modulesynopsis{Encode and decode files in binhex4 format.}
6
7
8This module encodes and decodes files in binhex4 format, a format
9allowing representation of Macintosh files in \ASCII. On the Macintosh,
10both forks of a file and the finder information are encoded (or
11decoded), on other platforms only the data fork is handled.
12
13The \module{binhex} module defines the following functions:
14
15\begin{funcdesc}{binhex}{input, output}
16Convert a binary file with filename \var{input} to binhex file
17\var{output}. The \var{output} parameter can either be a filename or a
18file-like object (any object supporting a \method{write()} and
19\method{close()} method).
20\end{funcdesc}
21
22\begin{funcdesc}{hexbin}{input\optional{, output}}
23Decode a binhex file \var{input}. \var{input} may be a filename or a
24file-like object supporting \method{read()} and \method{close()} methods.
25The resulting file is written to a file named \var{output}, unless the
26argument is omitted in which case the output filename is read from the
27binhex file.
28\end{funcdesc}
29
30The following exception is also defined:
31
32\begin{excdesc}{Error}
33Exception raised when something can't be encoded using the binhex
34format (for example, a filename is too long to fit in the filename
35field), or when input is not properly encoded binhex data.
36\end{excdesc}
37
38
39\begin{seealso}
40 \seemodule{binascii}{Support module containing \ASCII-to-binary
41 and binary-to-\ASCII{} conversions.}
42\end{seealso}
43
44
45\subsection{Notes \label{binhex-notes}}
46
47There is an alternative, more powerful interface to the coder and
48decoder, see the source for details.
49
50If you code or decode textfiles on non-Macintosh platforms they will
51still use the Macintosh newline convention (carriage-return as end of
52line).
53
54As of this writing, \function{hexbin()} appears to not work in all
55cases.
Note: See TracBrowser for help on using the repository browser.