Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 1 | \section{Standard Module \module{binhex}} |
Fred Drake | b91e934 | 1998-07-23 17:59:49 +0000 | [diff] [blame] | 2 | \declaremodule{standard}{binhex} |
| 3 | |
| 4 | \modulesynopsis{Encode and decode files in binhex4 format.} |
| 5 | |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 6 | |
| 7 | This module encodes and decodes files in binhex4 format, a format |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 8 | allowing representation of Macintosh files in \ASCII{}. On the Macintosh, |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 9 | both forks of a file and the finder information are encoded (or |
| 10 | decoded), on other platforms only the data fork is handled. |
| 11 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 12 | The \module{binhex} module defines the following functions: |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 13 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 14 | \begin{funcdesc}{binhex}{input, output} |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 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 | |
Fred Drake | cce1090 | 1998-03-17 06:33:25 +0000 | [diff] [blame] | 21 | \begin{funcdesc}{hexbin}{input\optional{, output}} |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 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 |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 34 | still use the Macintosh newline convention (carriage-return as end of |
Fred Drake | 1aabe5e | 1998-02-19 18:29:18 +0000 | [diff] [blame] | 35 | line). |
| 36 | |
Fred Drake | fc57619 | 1998-04-04 07:15:02 +0000 | [diff] [blame] | 37 | As of this writing, \function{hexbin()} appears to not work in all |
| 38 | cases. |