* Thus wrote Scott Fletcher:
> Nah! I'll settle for a simplier one... file_exists() by checking to see
> if the file exist then spit out the error message. Meaning the file is in
> use...
Don't use file_exists() for that, it will fail miserable with
racing conditions. a better more portable way would be to use
mkdir():
if (mkdir('mylockdir', 0755) ) {
// we've obtained a lock
// do stuff
// and unlock it
rmdir('mylockdir');
} else {
// unable to obtain lock
}
Curt
--
First, let me assure you that this is not one of those shady pyramid schemes
you've been hearing about. No, sir. Our model is the trapezoid!
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php