>>     fd.write('0')
[cut]
> 
> f = file('large_file.bin','wb')
> f.seek(409600000-1)
> f.write('\x00')

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):

   [EMAIL PROTECTED]:~/temp$ xxd op.bin
   0000000: 3030 3030 3030 3030 3030       0000000000
   [EMAIL PROTECTED]:~/temp$ xxd new.bin
   0000000: 0000 0000 0000 0000 0000       ..........

(using only length 10 instead of 400 megs to save time and disk 
space...)

-tkc





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

Reply via email to