How to abort a ftp operation
ville at spammers.com
Tue Jul 6 12:12:15 CEST 2004
>>>>> "Lothar" == Lothar Scholz <dummy at scriptolutions.com> writes:
Lothar> asynchronously from another thread. Is it possible to
Lothar> simply close the socket handle from another thread, which
Lothar> should result in some kind of protocol error on the ftp
ftplib.py has the following method in FTP class:
'''Abort a file transfer. Uses out-of-band data.
This does not follow the procedure from the RFC to send Telnet
IP and Synch; that doesn't seem to work with the servers I've
tried. Instead, just send the ABOR command as OOB data.'''
line = 'ABOR' + CRLF
if self.debugging > 1: print '*put urgent*', self.sanitize(line)
resp = self.getmultiline()
if resp[:3] not in ('426', '226'):
raise error_proto, resp
Try that, or just do ftpobject.sock.close()..
Ville Vainio http://tinyurl.com/2prnb
More information about the Python-list