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