Dear me, replying to myself twice in one day...

On Wed, 13 Jul 2005 00:39:14 +1000, Steven D'Aprano wrote:

> Then, if you are concerned that the files really are huge, that is, as big
> or bigger than the free memory your computer has, read and write them in
> chunks:
> 
> data = infile.read(64)  # 64 bytes at a time is a bit small...
> outfile.write(data)

Sorry, that should be in a loop:

data = "anything"
while data:
    data = infile.read(64)  # data will be empty when the file is read
    outfile.write(data)

-- 
Steven.


-- 
http://mail.python.org/mailman/listinfo/python-list

Reply via email to