Lines Matching defs:file
3 Based on RFC 959: File Transfer Protocol (FTP), by J. Postel and J. Reynolds
92 To download a file, use ftp.retrlines('RETR ' + filename),
94 To upload a file, use ftp.storlines() or ftp.storbinary(),
95 which have an open file as argument (see their definitions
105 file = None
134 self.file = self.sock.makefile('rb')
183 line = self.file.readline()
230 '''Abort a file transfer. Uses out-of-band data.
449 """Store a file in binary mode. A new port is created for you.
453 fp: A file-like object with a read(num_bytes) method.
474 """Store a file in line mode. A new port is created for you.
478 fp: A file-like object with a readline() method.
528 '''Rename a file.'''
535 '''Delete a file.'''
556 '''Retrieve the size of a file.'''
588 if self.file is not None:
589 self.file.close()
592 self.file = self.sock = None
656 self.file = self.sock.makefile(mode='rb')
865 '''Copy file from one FTP-instance to another.'''
886 See the netrc(4) man page for information on the file format.
902 "specify file to load or set $HOME"
961 """Return a list of hosts mentioned in the .netrc file."""
992 Usage: ftp [-d] [-r[file]] host [-l[dir]] [-d[dir]] [-p] [file] ...
1009 # get name of alternate ~/.netrc file:
1020 sys.stderr.write("Could not open account file"
1030 for file in sys.argv[2:]:
1031 if file[:2] == '-l':
1032 ftp.dir(file[2:])
1033 elif file[:2] == '-d':
1035 if file[2:]: cmd = cmd + ' ' + file[2:]
1037 elif file == '-p':
1040 ftp.retrbinary('RETR ' + file, \