note 53882 rejected from function.fwrite by mazzanet

From: Date: Thu, 16 Jun 2005 05:39:30 +0000
Subject: note 53882 rejected from function.fwrite by mazzanet
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-90503@lists.php.net to get a copy of this message
Note Submitter: leemansbart at hotmail dot com ---- I think there is a tiny delay in writing to the file... It took me +- 7 hours unitl I found this error (nut a bug actually). I'm working on a site where you first write the status to a file, and then let other functions check the status. The problem is, that when you refresh the site prety fast or have a lot of users on it, it gives an error when parsing the data in the file. I did use the "fclose($file);" command, and checked very thourougly that it did come from the writing to the status file. I also execute is_writable($file) or is_readable($file) in every function that requires it when calling the file. The only possible solution I seem o find is to update the status less, every 60 sec or so, and call the sleep(1); command to let the script wait for the file to be written. My best guess is that this error appears because of the Windows cache ? (I write a new file, not appending to the previous one.)

« previous php.notes (#90503) next »