ID: 34262 Updated by: [EMAIL PROTECTED] Reported By: hkncs06 at gmail dot com -Status: Open +Status: Bogus Bug Type: *General Issues -Operating System: Windows XP +Operating System: * -PHP Version: 5.0.4 +PHP Version: * New Comment:
Thank you for taking the time to write to us, but this is not a bug. Please double-check the documentation available at http://www.php.net/manual/ and the instructions on how to report a bug at http://bugs.php.net/how-to-report.php "a" means that you always append at the end of the file, this information is read upon opening and kept up to date during writing. Thus if you don't lock and both open at the same time the file will only contain the writes of the latter. Previous Comments: ------------------------------------------------------------------------ [2005-08-25 23:28:03] hkncs06 at gmail dot com 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 this bug report at http://bugs.php.net/?id=34262&edit=1
