note 17208 deleted from function.is-dir by jimw

From: Date: Tue, 18 Dec 2001 19:35:01 +0000
Subject: note 17208 deleted from function.is-dir by jimw
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-23162@lists.php.net to get a copy of this message
I've often found that under Windows NT, is_dir fails to work correctly. The way to make it work right is to enter the total path using get_cwd(). Beneath is an example of a snippet I use to load modules from a module dir: // file_exists does work right if(file_exists($dir)) { $handle = opendir($dir) or die("Directory \"$dir\" not found."); while($entry = readdir($handle)) { if(is_dir(getcwd() . "/$dir/$entry") !== FALSE and $entry != ".." and $entry != ".") { $modules[$i] = new Module("$dir/" . $entry); $i++; } } closedir($dir); }

« previous php.notes (#23162) next »