Re: readdir and mime types

From: Date: Tue, 22 Nov 2005 21:40:10 +0000
Subject: Re: readdir and mime types
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-226305@lists.php.net to get a copy of this message
On Tue, November 22, 2005 8:23 am, Graham Cossey wrote: > I'm attempting to read a list of files in a directory using readdir() > but am having problems with mpeg files not seemingly being read. > > Cope snippet: > > $count = 0; > while (false !== ($file = readdir($open_dir))) > { > if ($file != '.' && $file != '..') > { > if (file_exists("$VID_DIR/$file")) What is $VID_DIR? What directory is $open_dir pointing to? Dollar gets you 10 that at least one of them is not what you think it is. > { > $count++; > > $count counts any 'avi' files but not 'mpg' files. > > Any suggestions much apreciated. It's also remotely possible that your 'mpg' files are not readable by the PHP user or something weird like that... Though I don't THINK you can do this, it's possible that your OS allows it... -- Like Music? http://l-i-e.com/artists.htm

« previous php.general (#226305) next »