markseger has asked for the wisdom of the Perl Monks concerning the following question:
and as expected, when I run it on a webserver it reports the number of files in /tmp.#!/usr/bin/perl -w my $foo="/tmp/*"; my @glob=glob($foo); my $size=scalar(@glob); print "Content-type: text/html\n\n"; print "<html><head>\n"; print "SIZE: $size\n"; print"</head></html>\n";
But when I run in on RHEL6.2 in a VirtualBox VM it reports 0. Furthermore, when I point it to a different directory, in my case /usr/share/collectl/plotfiles, it works correctly. Since /tmp has the sticky bit set I even created /tmp2 and tried it against that directory. Still reported 0.
I had convinced myself it was a problem in RHEL6.2 but then I remembered I has another system running VMware/RHEL6.2 and I tried it there and it works fine! This makes me wonder if there's something funky about a vm in the virtualbox environment and/or a possible problem with glob itself in such an environment.
I did try running readdir instead of glob and it worked just fine, but I'd really like to get to the bottom of this if th is really is a bug.
Can anyone suggest any other experiments I might be able to try to add more context to this?
-mark
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Might there be some bug in glob under apache?
by Anonymous Monk on Feb 14, 2012 at 21:17 UTC | |
by markseger (Beadle) on Feb 14, 2012 at 21:25 UTC | |
by Anonymous Monk on Feb 14, 2012 at 21:45 UTC | |
by markseger (Beadle) on Feb 14, 2012 at 22:51 UTC | |
by Anonymous Monk on Feb 14, 2012 at 23:22 UTC | |
|