Hello
There are two ways you can add a line to the top of file:
- Read the entire file into memory, add your line, write back.
- 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,,,