PHP 4.3.10_2 readdir() misses files

Joerg Anslik joerg at anslik.de
Mon Feb 7 08:56:17 PST 2005


Hi,

if someone here has PHP 4.3.10_2 installed...do me a favor and try
this one:

----------
<?php
if(($dh = @opendir("/tmp")) == false) {

	print "No such dir!\n";
	
	exit;
}

while($entry = readdir($dh)) {

	print "[$entry]\n";
	}
	
	closedir($dh);
?>
----------

On my machine, there are currently 12 files/dirs in /tmp, but PHP only
catches five of them. I made a test directory containing 10 copies of
/etc/hosts, all same permissions, etc., and again, PHP misses files
and only shows four out of ten (always the same files).

I did a buildworld/kernel today and been facing the problem since
then; the same code snippet worked correct until yesterday. And yes, I
also re-installed PHP, etc. to be sure everything is up to date.

The same mechanism in C, however, yields the correct output. So, if
anyone would do a test run with this PHP stuff and inform me of the
results, I'd appreciate that!

Tnx

--j

------------------
cd /pub
more beer





More information about the Users mailing list