#28289 [Opn->Csd]: glob /xx relative to curdir, not curdrive under windows
| From: | iliaa@php.net | Date: | Sun, 09 May 2004 19:01:33 +0000 |
| Subject: | #28289 [Opn->Csd]: glob /xx relative to curdir, not curdrive under windows | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-59437@lists.php.net to get a copy of this message | ||
ID: 28289
Updated by: iliaa@php.net
Reported By: xuefer at 21cn dot com
-Status: Open
+Status: Closed
Bug Type: Filesystem function related
Operating System: winxp
PHP Version: 4.3.6
New Comment:
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
Previous Comments:
------------------------------------------------------------------------
[2004-05-06 08:03:49] 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-06 06:01:45] 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-05 19:40:02] 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
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=28289&edit=1