#22641 [Opn->Bgs]: Glob over NFS
| From: | iliaa@php.net | Date: | Wed, 12 Mar 2003 01:51:11 +0000 |
| Subject: | #22641 [Opn->Bgs]: Glob over NFS | ||
| References: | 1 | Groups: | php.bugs |
| Request: | Send a blank email to php-bugs+get-35380@lists.php.net to get a copy of this message | ||
ID: 22641
Updated by: iliaa@php.net
Reported By: sthomas at townnews dot com
-Status: Open
+Status: Bogus
Bug Type: Filesystem function related
Operating System: Redhat 7.3
PHP Version: 4.3.1
New Comment:
Sorry, but your problem does not imply a bug in PHP itself. For a
list of more appropriate places to ask for help using PHP, please
visit http://www.php.net/support.php as this bug system
is not the
appropriate forum for asking support questions.
Thank you for your interest in PHP.
I've just tried you sample C program on a system using glibc 2.2.5 and
can confirm that the problem is indeed glibc related and not the fault
of PHP. Please contact the glibc developers about this bug.
Previous Comments:
------------------------------------------------------------------------
[2003-03-11 16:49:21] sthomas at townnews dot com
Not sure this is relevant, but I used this code to test
glob itself, and the problem with NFS persists. If that's
the case, this is actually a bug in GLIBC. Can someone
confirm? When I ran this over an NFS, it didn't mark the non-directory
with a /, so it obviously knows the file isn't a directory... why then
does it include it in the results? Weird.
------------------------------
#include <glob.h>
#include <stdio.h>
int main()
{
glob_t globbuf;
int i;
globbuf.gl_offs = 15;
glob("/nfs-dir/*", GLOB_ONLYDIR | GLOB_MARK, NULL,
&globbuf);
for(i = 0; i < globbuf.gl_pathc; i++)
printf("%s\n",globbuf.gl_pathv[i]);
globfree(&globbuf);
return(0);
}
------------------------------
------------------------------------------------------------------------
[2003-03-11 15:52:50] sthomas at townnews dot com
When using glob over NFS, it appears that the flag GLOB_ONLYDIR does
not work.
<?PHP
print_r(glob("dir/*", GLOB_ONLYDIR));
print_r(glob("nfs-dir/*", GLOB_ONLYDIR));
?>
The first glob will only return the directories, which is correct.
However the second glob will return all files. The only difference
between these two directories is that nfs-dir is a directory mounted
over NFS.
------------------------------------------------------------------------
--
Edit this bug report at http://bugs.php.net/?id=22641&edit=1