Bug #15553: fopen() when using r+ overwrites whateva is at top
| From: | smythe at smythey dot org | Date: | Thu, 14 Feb 2002 14:35:05 +0000 |
| Subject: | Bug #15553: fopen() when using r+ overwrites whateva is at top | ||
| Groups: | php.bugs | ||
| Request: | Send a blank email to php-bugs+get-310@lists.php.net to get a copy of this message | ||
From: smythe@smythey.org
Operating system: Win2K
PHP version: 4.1.1
PHP Bug Type: Filesystem function related
Bug description: fopen() when using r+ overwrites whateva is at top
<?
$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 bug report at http://bugs.php.net/?id=15553&edit=1
--
Fixed in CVS: http://bugs.php.net/fix.php?id=15553&r=fixedcvs
Fixed in release: http://bugs.php.net/fix.php?id=15553&r=alreadyfixed
Need backtrace: http://bugs.php.net/fix.php?id=15553&r=needtrace
Try newer version: http://bugs.php.net/fix.php?id=15553&r=oldversion
Not developer issue: http://bugs.php.net/fix.php?id=15553&r=support
Expected behavior: http://bugs.php.net/fix.php?id=15553&r=notwrong
Not enough info: http://bugs.php.net/fix.php?id=15553&r=notenoughinfo
Submitted twice: http://bugs.php.net/fix.php?id=15553&r=submittedtwice