Entry
I'm currently using the storbinary method for transferring files, how can I get some indication that I've transferred xx% of the file, or 100,000 bytes so far?
Jun 5th, 2000 06:34
unknown unknown, Peter Schneider-Kamp
Just define your own version of storbinary in your module:
def mystorbinary(self, cmd, fp, blocksize):
'''Store a file in binary mode and print stuff.'''
self.voidcmd('TYPE I')
conn = self.transfercmd(cmd)
counter = 0
while 1:
print counter,"Bytes read yet."
buf = fp.read(blocksize)
if not buf: break
conn.send(buf)
counter = counter + blocksize
conn.close()
return self.voidresp()