|
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. |
38 | | - |
39 | | -\section{Standard Module \sectcode{uu}} |
40 | | -\stmodindex{uu} |
41 | | - |
42 | | -This module encodes and decodes files in uuencode format, allowing |
43 | | -arbitrary binary data to be transferred over ascii-only connections. |
44 | | -Wherever a file argument is expected, the methods accept a file-like |
45 | | -object. For backwards compatibility, a string containing a pathname |
46 | | -is also accepted, and the corresponding file will be opened for |
47 | | -reading and writing; the pathname \code{'-'} is understood to mean the |
48 | | -standard input or output. However, this interface is deprecated; it's |
49 | | -better for the caller to open the file itself, and be sure that, when |
50 | | -required, the mode is \code{'rb'} or \code{'wb'} on Windows or DOS. |
51 | | - |
52 | | -This code was contributed by Lance Ellinghouse, and modified by Jack |
53 | | -Jansen. |
54 | | - |
55 | | -The \code{uu} module defines the following functions: |
56 | | - |
57 | | -\setindexsubitem{(in module uu)} |
58 | | - |
59 | | -\begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}} |
60 | | -Uuencode file \var{in_file} into file \var{out_file}. The uuencoded |
61 | | -file will have the header specifying \var{name} and \var{mode} as the |
62 | | -defaults for the results of decoding the file. The default defaults |
63 | | -are taken from \var{in_file}, or \code{'-'} and \code{0666} |
64 | | -respectively. |
65 | | -\end{funcdesc} |
66 | | - |
67 | | -\begin{funcdesc}{decode}{in_file\optional{\, out_file\, mode}} |
68 | | -This call decodes uuencoded file \var{in_file} placing the result on |
69 | | -file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is |
70 | | -also set. Defaults for \var{out_file} and \var{mode} are taken from |
71 | | -the uuencode header. |
72 | | -\end{funcdesc} |
73 | | - |
74 | | -\section{Built-in Module \sectcode{binascii}} % If implemented in C |
| 1 | +\section{Built-in Module \sectcode{binascii}} |
| 2 | +\label{module-binascii} |
75 | 3 | \bimodindex{binascii} |
76 | 4 |
|
77 | 5 | The binascii module contains a number of methods to convert between |
|
0 commit comments