Re: is_file() can't tell the difference between file and directory in Win32...
| From: | Miha Nedok | Date: | Fri, 01 Nov 2002 22:51:04 +0000 |
| Subject: | Re: is_file() can't tell the difference between file and directory in Win32... | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-16683@lists.php.net to get a copy of this message | ||
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 <jdobson@tcgcorp.net>
> To: php-windows@lists.php.net
> 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
>