get writing to a certain position in a file somewhat more correct