I had similar problems. Use strcmp() with .. and . . Or use filetype() to determine if it is a file or directory or ...
Mike On Fri, 1 Nov 2002, Jack Kelly Dobson wrote: > Date: Fri, 1 Nov 2002 16:39:55 -0600 > From: Jack Kelly Dobson <[EMAIL PROTECTED]> > To: [EMAIL PROTECTED] > Subject: [PHP-WIN] is_file() can't tell the difference between file and > directory in Win32... > > 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- > > > > -- > PHP Windows Mailing List (http://www.php.net/) > To unsubscribe, visit: http://www.php.net/unsub.php > -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php