How to overwrite data in a text file
Posted 16 May 2006 - 02:51 AM
after appending bbbbb to file A which contains:
Is it possible to end up with:
? Thank you!
Seriously, I think I'm loosing more brain cells working out php than banging my head against the wall...
Posted 16 May 2006 - 09:21 AM
Posted 16 May 2006 - 09:54 AM
//Imports old data
$handle = f open($filename, "r");
$old_content = f read($handle, filesize ($filename));
//Sets up new data
$final_content = $data.$old_content;
//Writes new data
$handle2 = f open($filename, "w");
$finalwrite = f write($handle2, $final_content);
(apparently the gorum still has a problem with code using file open functions; therefore in the above, remove any space that immediately follows a 'f'; ie f open etc)
[br][br]The truely intelligent people are not those who create the dots; rather they are they ones with the ability to connect the dots into a coherent picture
all the brothers were valiant!
0 user(s) are reading this topic
0 members, 0 guests, 0 anonymous users