Please, can you help me?

From: Date: Fri, 03 May 2002 09:53:22 +0000
Subject: Please, can you help me?
Groups: php.general 
Request: Send a blank email to php-general+get-96163@lists.php.net to get a copy of this message
Hello! I have a big problem and cannot find the answer anywhere, so please, help me if you can. When I use fwrite() function on webserver, it sometimes happens, that more then one user accesses the file and the result is, that the file is corrupted or truncated. A good example of this problem is webpage access counter. I know, that I can use MySQL to count accesses, but on some servers I can't. When I have this counter as a file on my server and read/write into it, there's only a question of time, when it corrupts itself. Please, can you help me to solve this problem? I think, that the easiest solution should be to prevent more that one user to write to that file, but I have no idea, how to do this. Or is there any other way to prevent that files from their corruption? I'll be very happy, if you help me with this problem. Thank you in advance. Miloslav Dornak

« previous php.general (#96163) next »