ID:               22641
 User updated by:  sthomas at townnews dot com
 Reported By:      sthomas at townnews dot com
 Status:           Open
 Bug Type:         Filesystem function related
 Operating System: Redhat 7.3
 PHP Version:      4.3.1
 New Comment:

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);
}

------------------------------


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to