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