php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #14062 Wrong filetype displayed
Submitted: 2001-11-14 17:04 UTC Modified: 2001-11-15 02:15 UTC
From: corwin1974 at yahoo dot fr Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.0.6 OS: win98SE
Private report: No CVE-ID: None
 [2001-11-14 17:04 UTC] corwin1974 at yahoo dot fr
When running this script :
<?
  $d = "/fichiers";   // dir to show
  $h = opendir($d);
  while($e = readdir($h))
  {
    echo filetype("$d/$e");
    echo "<br>\n";
  }
  closedir($h);
?>

the wrong filetype is displayed (files and directories are displayed as directories), except when the script is run in the current (.) directory 

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2001-11-14 17:09 UTC] corwin1974 at yahoo dot fr
Sorry, the script is :
<?
  $d = "/fichiers";   // dir to show
  $h = opendir($d);
  while($e = readdir($h))
  {
    echo filetype("$e");
    echo "<br>\n";
  }
  closedir($h);
?>

The previous script is a workaround to get the right filetype.

 [2001-11-14 20:47 UTC] zak@php.net
I cannot reproduce this under Linux. File types are 
returned correctly.

Could someone with Win32 test this?

 [2001-11-15 02:15 UTC] derick@php.net
Then it's not a bug. Filetype works from the current directory, not from the directory you used with opendir().

Derick
 
PHP Copyright © 2001-2019 The PHP Group
All rights reserved.
Last updated: Mon Aug 19 00:01:27 2019 UTC