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
Welcome back! If you're the original bug submitter, here's where you can edit the bug or add additional notes.
If this is not your bug, you can add a comment by following this link.
If this is your bug, but you forgot your password, you can retrieve your password here.
Password:
Status:
Package:
Bug Type:
Summary:
From: corwin1974 at yahoo dot fr
New email:
PHP Version: OS:

 

 [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-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 19:01:31 2024 UTC