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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
35 - 30 = ?
Subscribe to this entry?

 
 [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

Pull Requests

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-2024 The PHP Group
All rights reserved.
Last updated: Mon Dec 02 18:01:31 2024 UTC