blob: 5b0e44168fc2c996f871d2d28c1a9a136ef16da8 [file] [log] [blame]
Fred Drake295da241998-08-10 19:42:37 +00001\section{\module{uu} ---
Fred Drake180b68b1999-02-22 13:45:09 +00002 Encode and decode uuencode files}
Fred Drakeb91e9341998-07-23 17:59:49 +00003
Fred Drake180b68b1999-02-22 13:45:09 +00004\declaremodule{standard}{uu}
Fred Drakeb91e9341998-07-23 17:59:49 +00005\modulesynopsis{Encode and decode files in uuencode format.}
Fred Drake180b68b1999-02-22 13:45:09 +00006\moduleauthor{Lance Ellinghouse}{}
Fred Drakeb91e9341998-07-23 17:59:49 +00007
Fred Drake1aabe5e1998-02-19 18:29:18 +00008
9This module encodes and decodes files in uuencode format, allowing
10arbitrary binary data to be transferred over ascii-only connections.
11Wherever a file argument is expected, the methods accept a file-like
12object. For backwards compatibility, a string containing a pathname
13is also accepted, and the corresponding file will be opened for
14reading and writing; the pathname \code{'-'} is understood to mean the
15standard input or output. However, this interface is deprecated; it's
16better for the caller to open the file itself, and be sure that, when
17required, the mode is \code{'rb'} or \code{'wb'} on Windows or DOS.
18
19This code was contributed by Lance Ellinghouse, and modified by Jack
20Jansen.
Fred Drake61f45c71998-04-04 06:31:51 +000021\index{Jansen, Jack}
22\index{Ellinghouse, Lance}
Fred Drake1aabe5e1998-02-19 18:29:18 +000023
24The \module{uu} module defines the following functions:
25
Fred Drake61f45c71998-04-04 06:31:51 +000026\begin{funcdesc}{encode}{in_file, out_file\optional{, name\optional{, mode}}}
Fred Drake1aabe5e1998-02-19 18:29:18 +000027Uuencode file \var{in_file} into file \var{out_file}. The uuencoded
28file will have the header specifying \var{name} and \var{mode} as the
29defaults for the results of decoding the file. The default defaults
30are taken from \var{in_file}, or \code{'-'} and \code{0666}
31respectively.
32\end{funcdesc}
33
Fred Drake61f45c71998-04-04 06:31:51 +000034\begin{funcdesc}{decode}{in_file\optional{, out_file\optional{, mode}}}
Fred Drake1aabe5e1998-02-19 18:29:18 +000035This call decodes uuencoded file \var{in_file} placing the result on
36file \var{out_file}. If \var{out_file} is a pathname the \var{mode} is
37also set. Defaults for \var{out_file} and \var{mode} are taken from
38the uuencode header.
39\end{funcdesc}