Re: is_dir() question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



maybe the following helps you (a little):

vlad georgescu wrote:
i have the code below
**
*if ($dir = @opendir("dir2open"))

$path = "dir2open"; // make this into a proper path!
if ($dir = @opendir($path))

{
while($file = readdir($dir)) {
//if (($file!='.') && ($file!='..') && ($file!='.htaccess') && ($file!='
index.php')) {
// if (is_dir($file)) { // print just "." & ".."

if (is_dir($path.$file)) {

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
// if (is_file($file)) { // works fine
if (!is_file($file) & ($file!='.') && ($file!='..') ) { // works fine (print
dir)

print $file."<br>";
}
}
}

closedir($dir);
*
the problem is that, function is_dir() returns true only for "." and ".."
is_file works fine, and I used !is_file() but ..... the question is: what is
wrong here?
 i use php4, but i don't think is a bug

you're right php4 is not a bug. :-)



--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php


[Index of Archives]     [PHP Home]     [Apache Users]     [PHP on Windows]     [Kernel Newbies]     [PHP Install]     [PHP Classes]     [Pear]     [Postgresql]     [Postgresql PHP]     [PHP on Windows]     [PHP Database Programming]     [PHP SOAP]

  Powered by Linux