php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #16257 is_dir enters infinite loop
Submitted: 2002-03-25 07:32 UTC Modified: 2002-07-03 05:42 UTC
From: denissov at hotmail dot com Assigned:
Status: Closed Package: Directory function related
PHP Version: 4.0.6 OS: Windows 98
Private report: No CVE-ID: None
 [2002-03-25 07:32 UTC] denissov at hotmail dot com
That happens when you want to check if the windows' swapfile is a ehm... a dir.

I'm using php 4.0.6 with Apache.

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2002-03-25 08:47 UTC] sander@php.net
Can you provide a sample script?
 [2002-03-25 10:36 UTC] denissov at hotmail dot com
I have manually set windows swapfile to another partition than C:. In the root I have a file called Win386.swp and when I try to list the root dir... well, here's the code:


$dir = "/";
print_r(listDir($dir));

function listDir ($dir=".") {
    $thisDir = opendir($dir);
    while($d = readdir($thisDir)) {
        if (is_dir("$dir/$d")) {
            $listDirs[] = $d;
        }
    }
    return $listDirs;
}
 [2002-07-03 05:42 UTC] sfox@php.net
I can't replicate this ..  

Suggest you upgrade PHP and re-open this bug report if you still have the problem - please, give your output or some clue as to the result you're getting as well as code another time.

Thanks -
 
PHP Copyright © 2001-2021 The PHP Group
All rights reserved.
Last updated: Sun Jun 20 16:01:23 2021 UTC