php.net |  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
Anyone can comment on a bug. Have a simpler test case? Does it work for you on a different platform? Let us know!
Just going to say 'Me too!'? Don't clutter the database with that please !
Your email address:
MUST BE VALID
Solve the problem:
5 - 3 = ?
Subscribe to this entry?

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


Reproduce code:
---------------
<?php
var_dump(glob("/abc/*"));
?>

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

Actual result:
--------------
empty array

Patches

Add a Patch

Pull Requests

Add a Pull Request

History

AllCommentsChangesGit/SVN commitsRelated reports
 [2004-05-06 06:01 UTC] fvignals at ibsmedia dot com
-- test 1 --
<?php
$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) {
  [0]=>
  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] iliaa@php.net
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
http://snaps.php.net/.
 
Thank you for the report, and for helping us make PHP better.

Because thread-safety requires wrappers around file 
operations. The  
 
PHP Copyright © 2001-2024 The PHP Group
All rights reserved.
Last updated: Wed Apr 24 19:01:31 2024 UTC