blob: 87182dca314d0f0bc34fa63f8e2907e32ab61873 [file] [log] [blame]
Fred Drake1aabe5e1998-02-19 18:29:18 +00001\section{Standard Module \sectcode{uu}}
2\label{module-uu}
3\stmodindex{uu}
4
5This module encodes and decodes files in uuencode format, allowing
6arbitrary binary data to be transferred over ascii-only connections.
7Wherever a file argument is expected, the methods accept a file-like
8object. For backwards compatibility, a string containing a pathname
9is also accepted, and the corresponding file will be opened for
10reading and writing; the pathname \code{'-'} is understood to mean the
11standard input or output. However, this interface is deprecated; it's
12better for the caller to open the file itself, and be sure that, when
13required, the mode is \code{'rb'} or \code{'wb'} on Windows or DOS.
14
15This code was contributed by Lance Ellinghouse, and modified by Jack
16Jansen.
17
18The \module{uu} module defines the following functions:
19
20\setindexsubitem{(in module uu)}
21
22\begin{funcdesc}{encode}{in_file\, out_file\optional{\, name\, mode}}
23Uuencode file \var{in_file} into file \var{out_file}. The uuencoded
24file will have the header specifying \var{name} and \var{mode} as the
25defaults for the results of decoding the file. The default defaults
26are taken from \var{in_file}, or \code{'-'} and \code{0666}
27respectively.
28\end{funcdesc}
29
30\begin{funcdesc}{decode}{in_file\optional{\, out_file\, mode}}
31This call decodes uuencoded file \var{in_file} placing the result on
32file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is
33also set. Defaults for \var{out_file} and \var{mode} are taken from
34the uuencode header.
35\end{funcdesc}