|
1 | 1 | \section{\module{ftplib} --- |
2 | | - FTP protocol client.} |
3 | | -\declaremodule{standard}{ftplib} |
| 2 | + FTP protocol client} |
4 | 3 |
|
| 4 | +\declaremodule{standard}{ftplib} |
5 | 5 | \modulesynopsis{FTP protocol client (requires sockets).} |
6 | 6 |
|
7 | | -\indexii{FTP}{protocol} |
8 | | - |
9 | 7 |
|
10 | 8 | This module defines the class \class{FTP} and a few related items. |
11 | | -The \class{FTP} class implements the client side of the FTP protocol. |
12 | | -You can use this to write Python programs that perform a variety of |
13 | | -automated FTP jobs, such as mirroring other ftp servers. It is also |
14 | | -used by the module \module{urllib} to handle URLs that use FTP. For |
15 | | -more information on FTP (File Transfer Protocol), see Internet |
16 | | -\rfc{959}. |
| 9 | +The \class{FTP} class implements the client side of the FTP |
| 10 | +protocol.\indexii{FTP}{protocol} You can use this to write Python |
| 11 | +programs that perform a variety of automated FTP jobs, such as |
| 12 | +mirroring other ftp servers. It is also used by the module |
| 13 | +\refmodule{urllib} to handle URLs that use FTP. For more information |
| 14 | +on FTP (File Transfer Protocol), see Internet \rfc{959}. |
17 | 15 |
|
18 | 16 | Here's a sample session using the \module{ftplib} module: |
19 | 17 |
|
@@ -71,8 +69,7 @@ \section{\module{ftplib} --- |
71 | 69 | \end{excdesc} |
72 | 70 |
|
73 | 71 |
|
74 | | -\subsection{FTP Objects} |
75 | | -\label{ftp-objects} |
| 72 | +\subsection{FTP Objects \label{ftp-objects}} |
76 | 73 |
|
77 | 74 | \class{FTP} instances have the following methods: |
78 | 75 |
|
@@ -104,7 +101,7 @@ \subsection{FTP Objects} |
104 | 101 | Log in as the given \var{user}. The \var{passwd} and \var{acct} |
105 | 102 | parameters are optional and default to the empty string. If no |
106 | 103 | \var{user} is specified, it defaults to \code{'anonymous'}. If |
107 | | -\var{user} is \code{anonymous}, the default \var{passwd} is |
| 104 | +\var{user} is \code{'anonymous'}, the default \var{passwd} is |
108 | 105 | \samp{\var{realuser}@\var{host}} where \var{realuser} is the real user |
109 | 106 | name (glanced from the \envvar{LOGNAME} or \envvar{USER} environment |
110 | 107 | variable) and \var{host} is the hostname as returned by |
@@ -151,6 +148,11 @@ \subsection{FTP Objects} |
151 | 148 | the line to \code{sys.stdout}. |
152 | 149 | \end{methoddesc} |
153 | 150 |
|
| 151 | +\begin{methoddesc}{set_pasv}{boolean} |
| 152 | +Enable ``passive'' mode if \var{boolean} is true, other disable |
| 153 | +passive mode. |
| 154 | +\end{methoddesc} |
| 155 | + |
154 | 156 | \begin{methoddesc}{storbinary}{command, file, blocksize} |
155 | 157 | Store a file in binary transfer mode. \var{command} should be an |
156 | 158 | appropriate \samp{STOR} command, i.e.\ \code{"STOR \var{filename}"}. |
|
0 commit comments