UPDATE: filtype() Problems



The files in question do give a filetype() and a '1' for file_exists() if I move them to the top level directory, but not when in the sub directory. Again, this only happens with some files. Others return valid types and '1's.

Is there a reason why I wouldn't be able to get filetype from some files in a directpory but not others? The permissions appear to be all correct and this happens on Windows IIS and Apache.

I'm at a loss... attached is the part of the script in question.

for ($i=0; $i < count($dirnames); $i++)
{
echo "<br/>";
echo $dirnames[$i] . "<br/>";
echo filetype($subnames[$dirnames[$i]][0]) . "<br>";

for ($b=0; $b < count($subnames[$dirnames[$i]], COUNT_RECURSIVE); $b++)

if (filetype($subnames[$dirnames[$i]][$b])=='file')
{ echo filetype($subnames[$dirnames[$i]][$b]) . " - " . $subnames[$dirnames[$i]][$b] . "<br/>";
}
}










Kevin Cloutier wrote:
Hi,

I wrote a simple script utilizing readdir() to read the contents of a directory, then of all subdirectories and thier contents and echo the filenames to the page.

But, here is the problem. I'm also echo'ing filtype() to ensure only files and not the directory names are printed. But I've noticed some of the files are not returning a type.

Has anyone seen this before? Am I just crazy?

Thanks for your help,

Kevin
.