ID: 31674 User updated by: miika dot ahonen at mbnet dot fi Reported By: miika dot ahonen at mbnet dot fi Status: Bogus Bug Type: *Directory/Filesystem functions Operating System: Linux PHP Version: 5.0.3 New Comment:
I don't think that explains why first doing chdir() to such directory and doing just glob("*") fails in similar manner. The chdir() works fine in such cases and with readdir() I can get everything I want from there without any problems. Previous Comments: ------------------------------------------------------------------------ [2005-01-24 08:10:08] [EMAIL PROTECTED] Brackets make a character class,just as in regular expressions. Escape them with a \. ------------------------------------------------------------------------ [2005-01-24 03:31:07] miika dot ahonen at mbnet dot fi Description: ------------ In an attempt to glob() directory with bracket ('[' and/or ']') in its name, I get no results at all. Reproduce code: --------------- $dir = "./dir[with]brackets"; if (!is_dir($dir)) mkdir($dir); for ($i = 0; $i < 3; $i++) file_put_contents($dir."/file.".$i, "foo".$i."\n"); var_dump( glob($dir."/*") ); Expected result: ---------------- Array containing files in the said directory. Actual result: -------------- Empty array. ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=31674&edit=1