ID:               51109
 Updated by:       ras...@php.net
 Reported By:      animatorboy at verizon dot net
-Status:           Open
+Status:           Feedback
 Bug Type:         Filesystem function related
 Operating System: Linux
 PHP Version:      5.2.12
 New Comment:

Really?  That simple 3-line test write "TEST" twice to the file?  
Forget your other code, just run the simple test.  I certainly can't 
reproduce that here and I am very skeptical that you can reproduce it 
with that code as well.


Previous Comments:
------------------------------------------------------------------------

[2010-02-22 04:59:38] animatorboy at verizon dot net

Description:
------------
When I try to write to a file, whether the file exists or not the text

sent is written twice.  I tried using a counter to see if it was
looping 
somewhere however it proved that the code was only run once.

Reproduce code:
---------------
$msg = 'TEST';
$fp = ('./logs/somefile.php');
file_put_contents($fp,$msg,FILE_APPEND);

or

$msg = 'TEST';
$fp = fopen('./logs/somefile.php','ab');
flock($fp, LOCK_EX);    
fwrite($fp, $msg);
flock($fp, LOCK_UN);
fclose($fp);

Expected result:
----------------
TEST

Actual result:
--------------
TESTEST


------------------------------------------------------------------------


-- 
Edit this bug report at http://bugs.php.net/?id=51109&edit=1

Reply via email to