Jan Danielsson wrote: > Is there any way to create a file with a specified size?
Besides the simple def make_empty_file(filename, size): f = open(filename, "wb") f.write("\0" * size) f.close() ? If the file is large, try (after testing and fixing any bugs): def make_empty_file(filename, size, block = 32*1024): f = open(filename, "wb") written = 0 s = "\0" * block for i in range(size//block): f.write(s) remainder = size%block f.write(s[:remainder]) f.close() As Grant Edwards pointed out, you can do a seek(size-1) but I don't know if it's fully portable. Andrew [EMAIL PROTECTED] -- http://mail.python.org/mailman/listinfo/python-list