FTP not Returning (Python on Series 60 Nokia)
mbukhin at gmail.com
mbukhin at gmail.com
Wed Mar 29 02:40:18 EST 2006
I'm using the ftp library (layer on top of sockets) to transfer files
from a series 60 to an ftp site. everything works fine, the whole
file gets uploaded but the command never returns! so
i call:
ftp.storbinary('STOR ' + filename,F,1024) # store the image
which does this:
def storbinary(self, cmd, fp, blocksize=8192):
'''Store a file in binary mode.'''
self.voidcmd('TYPE I')
conn = self.transfercmd(cmd)
while 1:
buf = fp.read(blocksize)
if not buf: break
conn.send(buf)
conn.close()
return self.voidresp()
and the 'while 1' never stops. That's my guess anyway. When I run
this in interactive bluetooth mode the storbinary command just hangs
(though the file ends up on the server). i've tried a bunch of
different things, counters, comparisons, everything. there's a signal
library in python but i don't think it's supported in mobile devices.
any suggestions?
thanks!
More information about the Python-list
mailing list