php.net |  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #41155 Virtual drives return "failed to open dir: Bad file descriptor"
Submitted: 2007-04-21 08:12 UTC Modified: 2007-05-02 09:52 UTC
From: fantasysportswire at yahoo dot com Assigned: dmitry (profile)
Status: Closed Package: *Directory/Filesystem functions
PHP Version: 5.2.1 OS: WINXP SP 2
Private report: No CVE-ID: None
View Add Comment Developer Edit
Welcome! If you don't have a Git account, you can't do anything here.
You can add a comment by following this link or if you reported this bug, you can edit this bug over here.
(description)
Block user comment
Status: Assign to:
Package:
Bug Type:
Summary:
From: fantasysportswire at yahoo dot com
New email:
PHP Version: OS:

 

 [2007-04-21 08:12 UTC] fantasysportswire at yahoo dot com
Description:
------------
If I use  scandir on a virtual drive it returns: 

Warning: scandir(w:): failed to open dir: Bad file descriptor

I have also tried w:\ and w:/ to the same result.

However... scandir("w:\\folder") works just fine.


realpath does almost the same thing... if from w: I run a script with:

<?
echo realpath(".");
?>

and run it like 

php -n script.php

... I get nothing


If I go into "folder" and run it

php -n w:\script.php

I returns

w:\folder


Just to repeat - this only seems to happen in a Virtual (subst) root path.  Inside folders in the virtual path work fine.

Both incidents happen using the -n flag, so there is no possible setting issue.


Reproduce code:
---------------
<?
echo realpath(".")."\n";
print_r(scandir("."));
?>

Expected result:
----------------
Current Path and an array dump of the files.

Actual result:
--------------
Nothing for realpath and "Warning: scandir(w:): failed to open dir: Bad file descriptor" for scandir

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2007-04-21 08:15 UTC] fantasysportswire at yahoo dot com
It also occurs with 5.2.2RC2-dev
 [2007-04-26 06:07 UTC] fantasysportswire at yahoo dot com
Just an FYI.

I do know that this issue did not exist in 5.0.5 ... I did not use any versions between 5.0.5 and 5.2.1 on Windows... so not sure where it first appeared - though six months ago or so or so I ran into it with the newest version... and switched back to 5.0.5... not sure if that was still 2.0 or 2.1...
 [2007-05-02 09:52 UTC] dmitry@php.net
The bug seems to be already fixed in 5.2.2RC2.
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Thu May 02 14:01:34 2024 UTC