blob: b6dc318e36045ffc5ca0354f09ee0aeb59f16afd [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
Fred Drake7475e04f1999-04-23 15:57:23 +000030are taken from \var{in_file}, or \code{'-'} and \code{0666} respectively.
Fred Drake1aabe5e1998-02-19 18:29:18 +000031\end{funcdesc}
32
Fred Drake61f45c71998-04-04 06:31:51 +000033\begin{funcdesc}{decode}{in_file\optional{, out_file\optional{, mode}}}
Fred Drake1aabe5e1998-02-19 18:29:18 +000034This call decodes uuencoded file \var{in_file} placing the result on
Fred Drake7475e04f1999-04-23 15:57:23 +000035file \var{out_file}. If \var{out_file} is a pathname, \var{mode} is
36used to set the permission bits if the file must be created. Defaults
37for \var{out_file} and \var{mode} are taken from the uuencode header.
Fred Drake1aabe5e1998-02-19 18:29:18 +000038\end{funcdesc}
Fred Drakeae35aa81999-04-23 15:52:18 +000039
40
41\begin{seealso}
42 \seemodule{binascii}{support module containing \ASCII{}-to-binary
43 and binary-to-\ASCII{} conversions}
44\end{seealso}