Re: PHP 4.0 Bug #5192 Updated: opendir fails in 4.0.0 where 3.0.12 worked

From: Date: Tue, 27 Jun 2000 16:56:29 +0000
Subject: Re: PHP 4.0 Bug #5192 Updated: opendir fails in 4.0.0 where 3.0.12 worked
References: 1  Groups: php.dev 
Request: Send a blank email to php-dev+get-22505@lists.php.net to get a copy of this message
On Wed, Jun 28, 2000 at 10:52:44AM -0000, Bug Database wrote: > ID: 5192 > Updated by: stas > Reported By: whit@transpect.com > Status: Feedback > Bug Type: Misbehaving function > Assigned To: > Comments: > > Please provide more info - what exactly doesn't work and in what circumstances. > > Full Bug description available at: > http://bugs.php.net/version4/?id=5192 With php4: "Warning: 1 is not a valid Directory resource in com.tag on line 12" And here is the included file through line 12 which failed in this case: <?php $comdir="/web/jh/in"; $id=strtok($PHP_SELF,"."); $tok=explode("/",$id); $tokcnt=count($tok); $tokdwn=($tokcnt-1); $id=$tok[$tokdwn]; $chk="$comdir"."/"."$id"; if(is_dir("$chk")) { opendir("$chk"); $fil=readdir(); This is absolutely reliable in php3.0.12. And it's not the way the $id variable is being derived - I have other similar routines which specify it more directly, which fail the same way in php4.0. Further, we have it passing the is_dir() test here, but then failing to open. Since it's a production system, I have to revert again now to the working version before too many folks run into this.... \/\/ I-I I T Blauvelt whit@transpect.com

« previous php.dev (#22505) next »