Home | History | Annotate | Download | only in python2.7

Lines Matching defs:FTP

1 """An FTP client class and some helper functions.
3 Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
7 >>> from ftplib import FTP
8 >>> ftp = FTP('ftp.python.org') # connect to host, default port
9 >>> ftp.login() # default, i.e.: user anonymous, passwd anonymous@
11 >>> ftp.retrlines('LIST') # list directory contents
17 d-wxrwxr-x 2 ftp wheel 1024 Sep 5 13:43 incoming
23 >>> ftp.quit()
50 __all__ = ["FTP","Netrc"]
56 # The standard FTP server control port
77 class FTP:
79 '''An FTP client class.
86 meaning that no timeout will be set on any ftp socket(s)
87 If a timeout is passed, then this is now the default timeout for all ftp
92 To download a file, use ftp.retrlines('RETR ' + filename),
93 or ftp.retrbinary() with slightly different arguments.
94 To upload a file, use ftp.storlines() or ftp.storbinary(),
110 # Initialize host to localhost, port to standard ftp port
379 # If there is no anonymous ftp password specified
384 # - We don't want to let ftp sites to discriminate by the user,
599 class FTP_TLS(FTP):
600 '''A FTP subclass which adds TLS support to FTP as described
603 Connect as usual to port 21 implicitly securing the FTP control
611 >>> ftps = FTP_TLS('ftp.python.org')
622 d-wxrwxr-x 2 ftp wheel 1024 Sep 5 13:43 incoming
639 FTP.__init__(self, host, user, passwd, acct, timeout)
644 return FTP.login(self, user, passwd, acct)
681 # --- Overridden FTP methods
684 conn, size = FTP.ntransfercmd(self, cmd, rest)
865 '''Copy file from one FTP-instance to another.'''
992 Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
1013 ftp = FTP(host)
1014 ftp.set_debuglevel(debugging)
1029 ftp.login(userid, passwd, acct)
1032 ftp.dir(file[2:])
1036 resp = ftp.sendcmd(cmd)
1038 ftp.set_pasv(not ftp.passiveserver)
1040 ftp.retrbinary('RETR ' + file, \
1042 ftp.quit()