|
php.net | support | documentation | report a bug | advanced search | search howto | statistics | random bug | login |
PatchesPull RequestsHistoryAllCommentsChangesGit/SVN commits
[2005-08-25 23:38 UTC] helly@php.net
|
|||||||||||||||||||||||||||
Copyright © 2001-2025 The PHP GroupAll rights reserved. |
Last updated: Mon Oct 27 15:00:01 2025 UTC |
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.