PHP 8.5.0 Alpha 1 available for testing

Voting

: two minus one?
(Example: nine)

The Note You're Voting On

danr at cvisual dot com dot com
17 years ago
Running PHP 5.2.0 on Apache Windows, I had a problem (likely the same one as described by others) where is_dir returned a False for directories with certain permissions even though they were accessible.

Strangely, I was able to overcome the problem with a more complete path. For example, this only displays "Works" on subdirectories with particular permissions (in this directory about 1 out of 3):

$d = opendir("./albums/mydir");
while(false !== ($f = readdir($d))) {
echo "<hr />";
if(is_dir($f)) {
echo "<b>Works:" . $f . "</b>";
}
}

However, this works properly for all directories:

$d = opendir("./albums/mydir");
while(false !== ($f = readdir($d))) {
echo "<hr />";
$dName = "./albums/mydir/" . $f;
if(is_dir($dName)) {
echo "<b>Works:" . $dName . "</b>";
}
}

I don't understand the hit-and-miss of the first code, but maybe the second code can help others having this problem.

<< Back to user notes page

To Top