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:[EMAIL PROTECTED]] 
Sent: 7. júlí 2001 21:56
To: [EMAIL PROTECTED]
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:      [EMAIL PROTECTED]
Homepage:    www.sed.is
------------------------------------------



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED] To
contact the list administrators, e-mail: [EMAIL PROTECTED]


--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]

Reply via email to