periodic file writing error (fputs)
| From: | Sarah Gray | Date: | Thu, 05 Aug 2004 18:50:14 +0000 |
| Subject: | periodic file writing error (fputs) | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-192915@lists.php.net to get a copy of this message | ||
Hello,
I am having a periodic problem that I cannot duplicate and wonder if
anyone has suggestions.
Once a sale is completed a record is written to a log file on the
server.
$filename = $dir. "/". $logType."_".$today.".txt";
$fp = fopen("$filename", "a+");
fputs($fp, $logEntryStr);
fclose($fp);
The file is chmoded to 644.
About 3 out of 600 times, the log file is not written to. The times
of day this happens are not consistent, and as I mentioned, I cannot
duplicate it when testing. I initially thought it was some kind of
error on the server, but I am beginning to think it is in my code.
Has anyone experienced anything like this or have any suggestions for
how to troubleshoot this?
Thanks,
Sarah