Creating file of size x

Grant Edwards grante at
Tue Jun 7 01:18:46 CEST 2005

On 2005-06-06, Jan Danielsson <jan.danielsson at> wrote:

>    Is there any way to create a file with a specified size?


 1) Open a new file for writing.
 2) Seek to "specified size"-1.
 3) Write one byte. 

Grant Edwards                   grante             Yow!  I just put lots of
                                  at               the EGG SALAD in the SILK
                                 SOCKS --

More information about the Python-list mailing list