I have a perl script that I use to check for the existence of certain directories on my site. Usually they do not exist. Whenever they do signals a problem. I'm trying to accomplish the same thing in php. I run into an error message when the directory does not exist using is_dir. Is there a better way to go about determining if the directory exists or not?
Here is what I'm using now:
if (is_dir ($lockingdir)) {
$locked = "Locked";
}
else {
$locked = "Unlocked";
}
and here is what I get:
Warning: stat failed for /mnt/web/guide/mysite/locks (errno=2 - No such file or directory)