You are here: UPDATE: filtype() Problems « PHP Programming Language « IT news, forums, messages
UPDATE: filtype() Problems

Posted by Kevin Cloutier on 12/30/05 06:02

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

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация