From:             hkncs06 at gmail dot com
Operating system: Windows XP
PHP version:      5.0.4
PHP Bug Type:     *General Issues
Bug description:  mutliple users cause write one but not another

Description:
------------
NOT sure if this is a bug or program issue. If two people acess the file
at the same time, would php write both of their information to the file or
one will write to the file and the other doesn't not. With the code below,
on the RequestLog.txt file, both of them on that file but only one on the
TimeRequested.csv file. Why is this happened? Or this happen because
someone is open the file (TimeRequested) while the other write to the
file. Any help would be appreciate.

Reproduce code:
---------------
$flog = fopen("RequestLog.txt","a");
                        fwrite($flog, $name);
                        fwrite($flog, " submitted on ");
                        fwrite($flog, $day);
                        fwrite($flog, " at ");
                        fwrite($flog, $time);
                        fwrite($flog, "\n");
                        fclose($flog);

                        if(file_exists("TimeRequested.csv"))
                        {
                                writeToFile();
                        }
                        else
                        {
                                writeToFileHeader();
                        }

Expected result:
----------------
All information of the two people access at the same time should be in the
TimeRequested.csv file

Actual result:
--------------
Only one information write to the file.

-- 
Edit bug report at http://bugs.php.net/?id=34262&edit=1
-- 
Try a CVS snapshot (php4):   http://bugs.php.net/fix.php?id=34262&r=trysnapshot4
Try a CVS snapshot (php5.0): 
http://bugs.php.net/fix.php?id=34262&r=trysnapshot50
Try a CVS snapshot (php5.1): 
http://bugs.php.net/fix.php?id=34262&r=trysnapshot51
Fixed in CVS:                http://bugs.php.net/fix.php?id=34262&r=fixedcvs
Fixed in release:            http://bugs.php.net/fix.php?id=34262&r=alreadyfixed
Need backtrace:              http://bugs.php.net/fix.php?id=34262&r=needtrace
Need Reproduce Script:       http://bugs.php.net/fix.php?id=34262&r=needscript
Try newer version:           http://bugs.php.net/fix.php?id=34262&r=oldversion
Not developer issue:         http://bugs.php.net/fix.php?id=34262&r=support
Expected behavior:           http://bugs.php.net/fix.php?id=34262&r=notwrong
Not enough info:             
http://bugs.php.net/fix.php?id=34262&r=notenoughinfo
Submitted twice:             
http://bugs.php.net/fix.php?id=34262&r=submittedtwice
register_globals:            http://bugs.php.net/fix.php?id=34262&r=globals
PHP 3 support discontinued:  http://bugs.php.net/fix.php?id=34262&r=php3
Daylight Savings:            http://bugs.php.net/fix.php?id=34262&r=dst
IIS Stability:               http://bugs.php.net/fix.php?id=34262&r=isapi
Install GNU Sed:             http://bugs.php.net/fix.php?id=34262&r=gnused
Floating point limitations:  http://bugs.php.net/fix.php?id=34262&r=float
No Zend Extensions:          http://bugs.php.net/fix.php?id=34262&r=nozend
MySQL Configuration Error:   http://bugs.php.net/fix.php?id=34262&r=mysqlcfg

Reply via email to