php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #23722 with dir() is_file() return always false ...
Submitted: 2003-05-20 13:30 UTC Modified: 2003-05-20 16:49 UTC
From: ca533512 at tiscali dot cz Assigned:
Status: Not a bug Package: *Directory/Filesystem functions
PHP Version: 4.3.2RC3 OS: win2k SP3
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: ca533512 at tiscali dot cz
New email:
PHP Version: OS:

 

 [2003-05-20 13:30 UTC] ca533512 at tiscali dot cz
I want to read a dir with dir() function and dir to open is like "images/php" then is_file() function doesn't working correctly ... (return false or NULL)

code:

$d = dir("images/php");
while ($file = $d -> read()) {
   if (is_file($file)) { // <- this line always return false
      ...
   }
}

when i use chdir() function to change directory, all working correctly ...

Must I use chdir() func. ???
is this a regular feature ???

jenik

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2003-05-20 16:49 UTC] nicos@php.net
Yes, it is an expected feature. You have to do if(is_file('images/php/'.$file)). dir() will not chdir so when you call is_file it tries to see if $file is present in your current directory.

Not a bug -> Bogus.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Fri Apr 19 01:01:28 2024 UTC