You cant insert data at the beginning of a file. Simply not possible.
What you need to do is read the entire file into memory (old data), then open the file for writing and write the new data to the file (overwriting the old datai in the file),
and then append the old data to the new file.
Or change your file layout so you can read the file onto an array. if you have the data in an array you can print the data in reverse. (you can also decide not to print all the data, or just the middle part, ever 2nd records, etc.)