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