Bug #686: file functions not working
| From: | z-kimmel at uiuc dot edu | Date: | Sun, 23 Aug 1998 05:31:42 +0000 |
| Subject: | Bug #686: file functions not working | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-519@lists.php.net to get a copy of this message | ||
From: z-kimmel@uiuc.edu
Operating system: NT 4
PHP version: 3.0.3
PHP Bug Type: Misbehaving function
Bug description:
I want to append text to the end of a file, but I can't seem to do it.
The following code doesn't work; the file is unchanged.
--------------------------------------
$fp = fopen($filename, "rw");
$pos=fseek($fp,5);
print($pos); # prints out 0, which is correct
$pos=ftell($fp);
print($pos); # prints out 5, which is correct
$error = fwrite($fp, "hello"); # does nothing
$error = fclose($fp);
--------------------------------------
The following code overwrites the file completely.
--------------------------------------
$fp = fopen($filename, "w");
$error = fclose($fp);
--------------------------------------
Anyone know of a workaround?
Thanks,
--Zeba Kimmel, z-kimmel@uiuc.edu
--
PHP Development Mailing List http://www.php.net/
To unsubscribe send an empty message to php-dev-unsubscribe@lists.php.net
For help: php-dev-help@lists.php.net