how write at the start of file?

Anishtain4

Registered User.
Local time
Today, 00:52
Joined
Apr 13, 2011
Messages
21
how can I write something at the start of a text file? I'm trying to make a log file and obviously latest actions should be on the top. I know that you can make another file and copy all the info of previous file after your desired log then replacing these files, but I want to know if there is any standard way for it?
 
read the file first and store the text in it as a string then recreate the file using your new infomation and the other string value that you read before so something like

read text file
store it as a string variable
then write the text file again using new info and old string. that would create the newest on the top
 
typically log files work the other way though - just append to the end of the text file
 

Users who are viewing this thread

Back
Top Bottom