/**
* Returns the current position of the file read/write pointer.
*
* @return mixed
*
* @since 1.7.0
*/
public function tell()
{
if (!$this->fh) {
$this->setError(Text::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
return false;
}
// Capture PHP errors
$php_errormsg = '';
$track_errors = ini_get('track_errors');
ini_set('track_errors', true);
switch ($this->processingmethod) {
case 'gz':
$res = gztell($this->fh);
break;
case 'bz':
case 'f':
default:
$res = ftell($this->fh);
break;
}
// May return 0 so check if it's really false
if ($res === false) {
$this->setError($php_errormsg);
}
// Restore error tracking to what it was before
ini_set('track_errors', $track_errors);
// Return the result
return $res;
}