writing large files quickly
grante at visi.com
Fri Jan 27 15:03:44 EST 2006
On 2006-01-27, Tim Chase <python.list at tim.thechases.com> wrote:
>> f = file('large_file.bin','wb')
> While a mindblowingly simple/elegant/fast solution (kudos!), the
> OP's file ends up with full of the character zero (ASCII 0x30),
> while your solution ends up full of the NUL character (ASCII 0x00):
Oops. I missed the fact that he was writing 0x30 and not 0x00.
Yes, the "hole" in the file will read as 0x00 bytes. If the OP
actually requires that the file contain something other than
0x00 bytes, then my solution won't work.
Grant Edwards grante Yow! I want the presidency
at so bad I can already taste
visi.com the hors d'oeuvres.
More information about the Python-list