#33047 [Opn->Fbk]: glob() doesn't work inside directories with brackets [ ]
| From: | iliaa@php.net | Date: | Tue, 17 May 2005 18:47:37 +0000 |
| Subject: | #33047 [Opn->Fbk]: glob() doesn't work inside directories with brackets [ ] | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-79111@lists.php.net to get a copy of this message | ||
ID: 33047
Updated by: iliaa@php.net
Reported By: wiseman1024 at gmail dot com
-Status: Open
+Status: Feedback
Bug Type: Directory function related
Operating System: Windows 2000
PHP Version: 4.3.9
New Comment:
Please try using this CVS snapshot:
http://snaps.php.net/php4-STABLE-latest.tar.gz
For Windows:
http://snaps.php.net/win32/php4-win32-STABLE-latest.zip
Previous Comments:
------------------------------------------------------------------------
[2005-05-17 18:09:30] wiseman1024 at gmail dot com
Description:
------------
glob() won't work (with any pattern and options whatsoever) when one
directory in the current working path has matching brackets [ and ]
with characters between the brackets.
This means glob() will fail if the current working directory is one
of:
C:\php\[hello]
C:\php\[hello]\hello
C:\php\xxx[hello]xxx
C:\php\[hello][
It will work, for example, if the current working directory is one of:
C:\php
C:\php\[hello
C:\php\hello]
C:\php\hello[]
This seems to be a problem when using regular expressions in the
implementation of glob.
Reproduce code:
---------------
/* Returns a list of files and directories, unless inside a directory
with something between brackets*/
print_r(glob('*',FALSE));
Expected result:
----------------
Should always return an array with the files (assuming there are files
in the current directory)
Actual result:
--------------
Nothing, because glob() returned false
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=33047&edit=1