|  support |  documentation |  report a bug |  advanced search |  search howto |  statistics |  random bug |  login
Bug #28289 glob /xx relative to curdir, not curdrive under windows
Submitted: 2004-05-05 19:40 UTC Modified: 2004-05-09 21:01 UTC
From: xuefer at 21cn dot com Assigned:
Status: Closed Package: Filesystem function related
PHP Version: 4.3.6 OS: winxp
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.
Block user comment
Status: Assign to:
Bug Type:
From: xuefer at 21cn dot com
New email:
PHP Version: OS:


 [2004-05-05 19:40 UTC] xuefer at 21cn dot com
path without driver letter(c: d:) failed to work
while other filesystem functions(file_get_contents/fopen) works
under *windows*

Reproduce code:

Expected result:
array with files in $cur_driver:/abc/ ($cur_driver = driver letter of getcwd())

Actual result:
empty array


Add a Patch

Pull Requests

Add a Pull Request


AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-06 06:01 UTC] fvignals at ibsmedia dot com
-- test 1 --
$path = getcwd();
$driver = $path[0]; // return "c"
print_r( glob( $driver.":\*" ) );
-- test 2 --
<?php print_r( glob( getcwd()."\*" ) ); ?>
-- test 3 --
<?php print_r( glob( "abc/*" ) ); ?>
-- test 4 --
<?php print_r( glob( "/abc/*" ) ); ?>

work under win xp pro and personal, win server 2003
(Note : Apache standalone and IIS services. )
 [2004-05-06 08:03 UTC] xuefer at 21cn dot com
it takes me so long time to figure it out: no, don't test it under /

C:\>mkdir tmp

C:\>cd tmp

C:\tmp>mkdir abc

C:\tmp>echo > abc\def

C:\tmp>d:\www\php4\cli\php.exe -r "var_dump(glob('/abc/*'));"
array(1) {
  string(8) "/abc/def"

C:\tmp>d:\www\php4\cli\php.exe -r "var_dump(glob('/tmp/abc/*'));"
array(0) {
 [2004-05-09 21:01 UTC]
This bug has been fixed in CVS.

Snapshots of the sources are packaged every three hours; this change
will be in the next snapshot. You can grab the snapshot at
Thank you for the report, and for helping us make PHP better.

Because thread-safety requires wrappers around file 
operations. The  
PHP Copyright © 2001-2023 The PHP Group
All rights reserved.
Last updated: Fri Mar 31 04:03:39 2023 UTC