#29960 [Opn]: DirectoryIterator::fileType

From: Date: Fri, 03 Sep 2004 06:27:15 +0000
Subject: #29960 [Opn]: DirectoryIterator::fileType
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969363755@lists.php.net to get a copy of this message
ID: 29960 Updated by: helly@php.net Reported By: asgarbutt at ucdavis dot edu Status: Open -Bug Type: *Directory/Filesystem functions +Bug Type: Documentation problem -Operating System: Windows XP Professional SP 2 +Operating System: * PHP Version: 5.0.1 New Comment: DirectoryIterator has no file*() functions Previous Comments: ------------------------------------------------------------------------ [2004-09-03 00:37:46] asgarbutt at ucdavis dot edu Found a better link to the SPL. It is still not complete, but it is much more thorough that the documentation provided on http://www.php.net/manual/en/function.directoryiterator-filetype.php It can be found here at : http://www.php.net/~helly/php/ext/spl/index.html Sorry about the bug post. ------------------------------------------------------------------------ [2004-09-03 00:27:08] asgarbutt at ucdavis dot edu In my description, i wrote the wrong quote. It should be ... Fatal error: Call to undefined method DirectoryIterator::fileType() in C:\Apache2\htdocs\imagearchive\test.php on line 40 as stated in the Actual result section. ------------------------------------------------------------------------ [2004-09-03 00:15:34] asgarbutt at ucdavis dot edu Description: ------------ When utilizing the new DirectoryIterator of PHP5 (5.0.1) I get the following message. Fatal error: Call to undefined method DirectoryIterator::fileExt() in C:\Apache2\htdocs\imagearchive\test.php on line 40 The function is listed in the documentation but only minimumly. Reproduce code: --------------- $sPath = 'C:\Apache2\htdocs' foreach (new DirectoryIterator($sPath) as $oFile) { if ($oFile->isFile()) { echo 'isFile => '.$oFile->isFile().'<br />'; echo 'getFilename => '.$oFile->getFilename().'<br />'; echo 'fileType => '.$oFile->fileType().'<br />'; } } Expected result: ---------------- isFile => 1 getFilename => apache_pb.gif fileType => .gif (or something similar) Actual result: -------------- isFile => 1 getFilename => apache_pb.gif Fatal error: Call to undefined method DirectoryIterator::fileType() in C:\Apache2\htdocs\imagearchive\test.php on line 40 ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=29960&edit=1

« previous php.doc (#969363755) next »