ID:               29960
 User updated by:  asgarbutt at ucdavis dot edu
 Reported By:      asgarbutt at ucdavis dot edu
 Status:           Open
 Bug Type:         *Directory/Filesystem functions
 Operating System: Windows XP Professional SP 2
 PHP Version:      5.0.1
 New Comment:

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.


Previous Comments:
------------------------------------------------------------------------

[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

Reply via email to