Actions

API16

JStream/eof

From Joomla! Documentation

< API16:JStream
Replacement filing cabinet.png
This Namespace has been archived - Please Do Not Edit or Create Pages in this namespace. Pages contain information for a Joomla! version which is no longer supported. It exists only as a historical reference, will not be improved and its content may be incomplete.

Contents

Description

Work out if we're at the end of the file for a stream

[Edit Descripton]

Description:JStream/eof

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;
}

[Edit See Also] SeeAlso:JStream/eof

Examples

<CodeExamplesForm />