write a 20GB file

Jackie Lee jackie.space at gmail.com
Fri May 14 22:45:06 EDT 2010


Thanks to y'all. I should have be more careful reading the documentation.

Cheers

On Fri, May 14, 2010 at 10:07 PM, Martin v. Loewis <martin at v.loewis.de> wrote:
>> The code works fine. I just don't know how f.write works. It says that
>> file.write won't write the file until file.close or file.flush.
>
> You are misinterpreting the documentation. It certainly won't keep the
> entire file in memory. Instead, it has a fixed-size buffer (something
> like 8kiB or 32kiB) in which it writes and which it flushes when that
> buffer is full.
>
> The comment about flush and close merely refers to the problem that some
> data may still be in the buffer at any point in time, unless you just
> called close or flush.
>
> HTH,
> Martin
>



-- 
Jackie



More information about the Python-list mailing list