is_file() can't tell the difference between file and directory in Win32...
| From: | Jack Kelly Dobson | Date: | Fri, 01 Nov 2002 22:39:55 +0000 |
| Subject: | is_file() can't tell the difference between file and directory in Win32... | ||
| Groups: | php.windows | ||
| Request: | Send a blank email to php-windows+get-16682@lists.php.net to get a copy of this message | ||
Hello,
This is the first time I've worked with these functions so I'm sure it's in
Indian, not the arrows.
This script identifies both files and directories as directories. What am I
doing wrong here?
I'm running as a .dll under IIS.
<?
function Get_Directory_Listing($path) {
if ($dir_handle = opendir($path)) {
while ($file = readdir($dir_handle)) {
if (($file != ".") && ($file != "..")) {
if (is_file($file)) {
print($file . " is a file.<BR>");
}
else {
print($file . " is a directory.<BR>");
}
}
}
closedir($dir_handle);
}
}
Get_Directory_Listing("/my_path");
?>
Thanks j-