annotate Doc/lib/libftplib.tex @ 5817:48b94de85bf3 legacy-trunk

Extensive changes by AMK.
author Guido van Rossum <guido@python.org>
date Thu, 17 Jul 1997 16:29:42 +0000
parents b218f294b726
children 3468ea8645ca
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
2576
f47bc5554418 mass changes; fix titles; add examples; correct typos; clarifications;
Guido van Rossum <guido@python.org>
parents: 2453
diff changeset
1 \section{Standard Module \sectcode{ftplib}}
2449
8eeecd233d56 added WWW sections
Guido van Rossum <guido@python.org>
parents:
diff changeset
2 \stmodindex{ftplib}
2453
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
3
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
4 \renewcommand{\indexsubitem}{(in module ftplib)}
cdd3a721b40e a few typographical changes (e.g. -- => ---) and lots of new stuff in the WWW chapter
Guido van Rossum <guido@python.org>
parents: 2449
diff changeset
5
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
6 This module defines the class \code{FTP} and a few related items. The
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
7 \code{FTP} class implements the client side of the FTP protocol. You
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
8 can use this to write Python programs that perform a variety of
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
9 automated FTP jobs, such as mirroring other ftp servers. It is also
2943
8edbeaa2bbf7 typos only
Guido van Rossum <guido@python.org>
parents: 2647
diff changeset
10 used by the module \code{urllib} to handle URLs that use FTP. For
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
11 more information on FTP (File Transfer Protocol), see Internet RFC
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
12 959.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
13
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
14 Here's a sample session using the \code{ftplib} module:
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
15
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
16 \begin{verbatim}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
17 >>> from ftplib import FTP
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
18 >>> ftp = FTP('ftp.cwi.nl') # connect to host, default port
2647
9b7e6d9a528d typos, layout and other small things
Guido van Rossum <guido@python.org>
parents: 2596
diff changeset
19 >>> ftp.login() # user anonymous, passwd user@hostname
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
20 >>> ftp.retrlines('LIST') # list directory contents
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
21 total 24418
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
22 drwxrwsr-x 5 ftp-usr pdmaint 1536 Mar 20 09:48 .
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
23 dr-xr-srwt 105 ftp-usr pdmaint 1536 Mar 21 14:32 ..
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
24 -rw-r--r-- 1 ftp-usr pdmaint 5305 Mar 20 09:48 INDEX
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
25 .
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
26 .
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
27 .
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
28 >>> ftp.quit()
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
29 \end{verbatim}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
30
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
31 The module defines the following items:
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
32
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
33 \begin{funcdesc}{FTP}{\optional{host\optional{\, user\, passwd\, acct}}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
34 Return a new instance of the \code{FTP} class. When
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
35 \var{host} is given, the method call \code{connect(\var{host})} is
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
36 made. When \var{user} is given, additionally the method call
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
37 \code{login(\var{user}, \var{passwd}, \var{acct})} is made (where
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
38 \var{passwd} and \var{acct} default to the empty string when not given).
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
39 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
40
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
41 \begin{datadesc}{all_errors}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
42 The set of all exceptions (as a tuple) that methods of \code{FTP}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
43 instances may raise as a result of problems with the FTP connection
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
44 (as opposed to programming errors made by the caller). This set
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
45 includes the four exceptions listed below as well as
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
46 \code{socket.error} and \code{IOError}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
47 \end{datadesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
48
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
49 \begin{excdesc}{error_reply}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
50 Exception raised when an unexpected reply is received from the server.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
51 \end{excdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
52
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
53 \begin{excdesc}{error_temp}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
54 Exception raised when an error code in the range 400--499 is received.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
55 \end{excdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
56
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
57 \begin{excdesc}{error_perm}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
58 Exception raised when an error code in the range 500--599 is received.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
59 \end{excdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
60
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
61 \begin{excdesc}{error_proto}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
62 Exception raised when a reply is received from the server that does
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
63 not begin with a digit in the range 1--5.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
64 \end{excdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
65
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
66 \subsection{FTP Objects}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
67
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
68 FTP instances have the following methods:
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
69
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
70 \renewcommand{\indexsubitem}{(FTP object method)}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
71
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
72 \begin{funcdesc}{set_debuglevel}{level}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
73 Set the instance's debugging level. This controls the amount of
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
74 debugging output printed. The default, 0, produces no debugging
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
75 output. A value of 1 produces a moderate amount of debugging output,
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
76 generally a single line per request. A value of 2 or higher produces
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
77 the maximum amount of debugging output, logging each line sent and
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
78 received on the control connection.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
79 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
80
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
81 \begin{funcdesc}{connect}{host\optional{\, port}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
82 Connect to the given host and port. The default port number is 21, as
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
83 specified by the FTP protocol specification. It is rarely needed to
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
84 specify a different port number. This function should be called only
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
85 once for each instance; it should not be called at all if a host was
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
86 given when the instance was created. All other methods can only be
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
87 used after a connection has been made.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
88 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
89
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
90 \begin{funcdesc}{getwelcome}{}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
91 Return the welcome message sent by the server in reply to the initial
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
92 connection. (This message sometimes contains disclaimers or help
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
93 information that may be relevant to the user.)
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
94 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
95
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
96 \begin{funcdesc}{login}{\optional{user\optional{\, passwd\optional{\, acct}}}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
97 Log in as the given \var{user}. The \var{passwd} and \var{acct}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
98 parameters are optional and default to the empty string. If no
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
99 \var{user} is specified, it defaults to \samp{anonymous}. If
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
100 \var{user} is \code{anonymous}, the default \var{passwd} is
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
101 \samp{\var{realuser}@\var{host}} where \var{realuser} is the real user
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
102 name (glanced from the \samp{LOGNAME} or \samp{USER} environment
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
103 variable) and \var{host} is the hostname as returned by
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
104 \code{socket.gethostname()}. This function should be called only
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
105 once for each instance, after a connection has been established; it
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
106 should not be called at all if a host and user were given when the
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
107 instance was created. Most FTP commands are only allowed after the
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
108 client has logged in.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
109 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
110
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
111 \begin{funcdesc}{abort}{}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
112 Abort a file transfer that is in progress. Using this does not always
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
113 work, but it's worth a try.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
114 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
115
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
116 \begin{funcdesc}{sendcmd}{command}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
117 Send a simple command string to the server and return the response
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
118 string.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
119 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
120
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
121 \begin{funcdesc}{voidcmd}{command}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
122 Send a simple command string to the server and handle the response.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
123 Return nothing if a response code in the range 200--299 is received.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
124 Raise an exception otherwise.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
125 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
126
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
127 \begin{funcdesc}{retrbinary}{command\, callback\, maxblocksize}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
128 Retrieve a file in binary transfer mode. \var{command} should be an
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
129 appropriate \samp{RETR} command, i.e.\ \code{"RETR \var{filename}"}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
130 The \var{callback} function is called for each block of data received,
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
131 with a single string argument giving the data block.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
132 The \var{maxblocksize} argument specifies the maximum block size
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
133 (which may not be the actual size of the data blocks passed to
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
134 \var{callback}).
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
135 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
136
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
137 \begin{funcdesc}{retrlines}{command\optional{\, callback}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
138 Retrieve a file or directory listing in \ASCII{} transfer mode.
4728
b218f294b726 (lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents: 2943
diff changeset
139 \var{command} should be an appropriate \samp{RETR} command (see
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
140 \code{retrbinary()} or a \samp{LIST} command (usually just the string
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
141 \code{"LIST"}). The \var{callback} function is called for each line,
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
142 with the trailing CRLF stripped. The default \var{callback} prints
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
143 the line to \code{sys.stdout}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
144 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
145
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
146 \begin{funcdesc}{storbinary}{command\, file\, blocksize}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
147 Store a file in binary transfer mode. \var{command} should be an
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
148 appropriate \samp{STOR} command, i.e.\ \code{"STOR \var{filename}"}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
149 \var{file} is an open file object which is read until EOF using its
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
150 \code{read()} method in blocks of size \var{blocksize} to provide the
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
151 data to be stored.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
152 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
153
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
154 \begin{funcdesc}{storlines}{command\, file}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
155 Store a file in \ASCII{} transfer mode. \var{command} should be an
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
156 appropriate \samp{STOR} command (see \code{storbinary()}). Lines are
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
157 read until EOF from the open file object \var{file} using its
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
158 \code{readline()} method to privide the data to be stored.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
159 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
160
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
161 \begin{funcdesc}{nlst}{argument\optional{\, \ldots}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
162 Return a list of files as returned by the \samp{NLST} command. The
4728
b218f294b726 (lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents: 2943
diff changeset
163 optional \var{argument} is a directory to list (default is the current
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
164 server directory). Multiple arguments can be used to pass
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
165 non-standard options to the \samp{NLST} command.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
166 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
167
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
168 \begin{funcdesc}{dir}{argument\optional{\, \ldots}}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
169 Return a directory listing as returned by the \samp{LIST} command, as
4728
b218f294b726 (lib<all sorts of stuff>.tex):
Fred Drake <fdrake@acm.org>
parents: 2943
diff changeset
170 a list of lines. The optional \var{argument} is a directory to list
2596
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
171 (default is the current server directory). Multiple arguments can be
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
172 used to pass non-standard options to the \samp{LIST} command. If the
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
173 last argument is a function, it is used as a \var{callback} function
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
174 as for \code{retrlines()}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
175 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
176
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
177 \begin{funcdesc}{rename}{fromname\, toname}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
178 Rename file \var{fromname} on the server to \var{toname}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
179 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
180
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
181 \begin{funcdesc}{cwd}{pathname}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
182 Set the current directory on the server.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
183 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
184
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
185 \begin{funcdesc}{mkd}{pathname}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
186 Create a new directory on the server.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
187 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
188
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
189 \begin{funcdesc}{pwd}{}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
190 Return the pathname of the current directory on the server.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
191 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
192
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
193 \begin{funcdesc}{quit}{}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
194 Send a \samp{QUIT} command to the server and close the connection.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
195 This is the ``polite'' way to close a connection, but it may raise an
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
196 exception of the server reponds with an error to the \code{QUIT}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
197 command.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
198 \end{funcdesc}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
199
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
200 \begin{funcdesc}{close}{}
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
201 Close the connection unilaterally. This should not be applied to an
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
202 already closed connection (e.g.\ after a successful call to
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
203 \code{quit()}.
31777622ae93 some new material
Guido van Rossum <guido@python.org>
parents: 2576
diff changeset
204 \end{funcdesc}