ID: 15553 Updated by: [EMAIL PROTECTED] Reported By: [EMAIL PROTECTED] -Status: Open +Status: Bogus Bug Type: Filesystem function related Operating System: Win2K PHP Version: 4.1.1 New Comment:
That's 'cause that what 'r+' does: http://www.php.net/fopen The underlying system call does not support prepending to files--this is a pretty common request, in fact. For solutions, please ask on the [EMAIL PROTECTED] support list or check out http://www.php.net/support.php for help. Torben Previous Comments: ------------------------------------------------------------------------ [2002-02-14 09:35:05] [EMAIL PROTECTED] <? $output = "\nGday.\n"; $directory = dirname($path_translated); $filename = fopen($directory . "members/addop.txt", "r+", 1) or die("Can't open file"); if ($output) { $written = fwrite($filename, $output) or die ("Couldn't write to file"); } fclose($filename); ?> When usin r+ it writes to the file addop.txt but just overwrites whateva is at the top. i want it to just add to the top of the file. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=15553&edit=1
