API16:JStream/eof
From Joomla! Documentation
Description
Work out if we're at the end of the file for a stream
Syntax
eof()
Defined in
libraries/joomla/filesystem/stream.php
Importing
jimport( 'joomla.filesystem.stream' );
Source Body
function eof()
{
if(!$this->_fh)
{
$this->setError(JText::_('File not open'));
return false;
}
$retval = false;
// Capture PHP errors
$php_errormsg = '';
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
switch($this->processingmethod)
{
case 'gz':
$res = gzeof($this->_fh);
break;
case 'bz':
case 'f':
default:
$res = feof($this->_fh);
break;
}
if($php_errormsg) {
$this->setError($php_errormsg);
}
// restore error tracking to what it was before
ini_set('track_errors',$track_errors);
// return the result
return $res;
}
Examples
Code Examples