This is the new home of the egghelp.org community forum.
All data has been migrated (including user logins/passwords) to a new phpBB version.


For more information, see this announcement post. Click the X in the top right-corner of this box to dismiss this message.

how to invert the writing to a file?

Old posts that have not been replied to for several years.
Locked
B
Black

Post by Black »

HI,

how can i invert the writing to a file. Normaly after puts a new line is appended at the bottom, but how invert this process and get the new data written on the top?


<font size=-1>[ This Message was edited by: Black on 2002-05-21 15:18 ]</font>
User avatar
stdragon
Owner
Posts: 959
Joined: Sun Sep 23, 2001 8:00 pm
Contact:

Post by stdragon »

Read in the whole file, reopen the file in creation mode, add the new line, then write all the old data back.
User avatar
Papillon
Owner
Posts: 724
Joined: Fri Feb 15, 2002 8:00 pm
Location: *.no

Post by Papillon »

well u can read the new line to a variable then overwrite the whole thing with the new line and then add the old lines at the end...
this seems to me like a very slow way to do it so there is probably some better way....which I don't know :wink:
..but I think it should work.


Elen sila lúmenn' omentielvo
Locked