View Single Post
Old Aug 12th, 2007, 6:48 PM   #3
Dameon
Troll
 
Dameon's Avatar
 
Join Date: Apr 2005
Location: Texas
Posts: 732
Rep Power: 4 Dameon is on a distinguished road
Since you mentioned appending to a file:
If you intend to insert lines at the beginning, you will have to shift the existing contents down. This involves reading in and writing out everything already there, of course, so will take even longer as files get bigger.

For reading a file backwards:
Read each line and store them all in memory. You can then access them in what ever order you please.
__________________
MD5(sig) = bcef75433db02e9ad9bf81d6f7c5c270
Dameon is offline   Reply With Quote