Re: different operations on files than dirs

From: Date: Thu, 16 Nov 2000 06:45:42 +0000
Subject: Re: different operations on files than dirs
References: 1 2  Groups: php.general 
Request: Send a blank email to php-general+get-25638@lists.php.net to get a copy of this message
On Thu, 16 Nov 2000, Kevin Ferron wrote: > Oops pulled the trigger too soon.. > > The problem I'm having with that code is that it ALWAYS returns true on the > elseif (the actions for files). > > I've tried is_file() flipflop also > > > ""Kevin Ferron"" <kevin_ferron@hotmail.com> wrote in message > news:8uvv9m$8lq$1@toye.p.sourceforge.net... > > I'm stuck.. variations on the following code is what I've been trying: > > > > $handle=opendir($this->dirshow); > > while (false!==($file = readdir($handle))) { I think that could better be done as while ($file = readdir($handle)) { > > if ($file != "." && $file != "..") { > > if (is_dir($file) == 1) { if (is_dir($file) { > > > > STUFF I WANT TO HAPPEN IF ITS A DIR > > } > > > > elseif (is_dir($file) == 0) { else { // If it's not a dir it must be a file > > IF ITS A FILE > > } > > > > Thanks for your help. > > > > phool -- David Robley | WEBMASTER & Mail List Admin RESEARCH CENTRE FOR INJURY STUDIES | http://www.nisu.flinders.edu.au/ AusEinet | http://auseinet.flinders.edu.au/ Flinders University, ADELAIDE, SOUTH AUSTRALIA

« previous php.general (#25638) next »