Corrected creating to the correct filesize

f.write(\'0') appends a character, so we need to seek to filesize-1
rather than just filesize