[paramiko] SFTP large files

Gary Hines ghines at shcdirect.com
Thu Oct 5 10:16:55 PDT 2006


Hi,
	I'm barely past the beginner phase with Python, but I'm finding
a need to automate some file transfers with sftp. It works great with
smaller files, but I'm getting Memory exceeded errors when I try larger
files. I think the following lines are the culprit:

          # copy file to testing
          data = file(filename,'r').read()
          sftp.open(filename,'w').write(data)

Is there a different way to do the copy that might be able to handle
larger files. I was thinking that maybe using a block size would work,
but I'm a little unsure. Any help would be greatly appreciated.

Gary Hines



More information about the paramiko mailing list