in reply to writing to top of a file

Hello

There are two ways you can add a line to the top of file:

  1. Read the entire file into memory, add your line, write back.
  2. Open a new file, add your line, open the old file, dump its content to the new file, close both files and rename.
Any other way will be using one of these 2 ways.

Aziz,,,