RE: [PHP] Strange problem with fputs ($fp, $newVote)
| From: | SED | Date: | Sat, 07 Jul 2001 22:20:15 +0000 |
| Subject: | RE: [PHP] Strange problem with fputs ($fp, $newVote) | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56684@lists.php.net to get a copy of this message | ||
Hi again,
I got around the problem just by doing following. However, the problem
is weird (I'm using PHP 4.0.5 for IIS).
$fp = fopen ($filename, "a+");
$fileContent = fread ($fp, filesize ($filename));
...
fclose ($fp);
$fp = fopen ($filename, "a"); <- the plus taken away!
ftruncate ($fp, 0);
fwrite ($fp, $newVote);
fclose ($fp);
Can this be a bug?
SED
-----Original Message-----
From: SED [mailto:sed@sed.is]
Sent: 7. júlí 2001 21:56
To: php-general@lists.php.net
Subject: [PHP] Strange problem with fputs ($fp, $newVote)
Hi,
I'm having strange problem with the fputs() - it occurs only on my IIS
server but not on the Linux/apache server (I use the IIS while
programming).
The problem:
fputs ($fp, $newVote);
It does not write the content of $newVote into the text file $fp is
pointing to. If I check the value of fputs like:
$test = fputs ($fp, $newVote);
echo $test;
I get the number "0" - but notice I don't get any error messages. Does
anyone know why this acts like that? If I echo the permission of the
file I get this: 33206 (what does that mean?).
Regards,
Sumarlidi Einar Dadason
SED - Graphic Design
------------------------------------------
Phone: (+354) 4615501
Mobile: (+354) 8960376
Fax: (+354) 4615503
E-mail: sed@sed.is
Homepage: www.sed.is
------------------------------------------
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net To
contact the list administrators, e-mail: php-list-admin@lists.php.net