To insert new data into a file you must open a new file, copy the data
from the beginning of the original file into the new file up to the
point where you want to insert new data, write your new data, pick up
copying the remaining data from the original file to the end of the
file, close the new and old files, delete the old file and rename the
new file to replace the old file.