english/libraries/joomla/filesystem/stream.php
/**
	 * Attempt to close a file handle
	 *
	 * Will return false if it failed and true on success
	 * @note: If the file is not open the system will return true
	 * @note: this function destroys the file handle as well
	 *
	 * @return  boolean
	 *
	 * @since   11.1
	 */
Attempt to close a file handle
Will return false if it failed and true on success
@note: If the file is not open the system will return true
@note: this function destroys the file handle as well

@return  boolean


Attempt to close a file handle Will return false if it failed and true on success @note : If the file is not open the system will return true @note : this function destroys the file handle as well @return boolean
function close()
	{
		if (!$this->_fh) {
			$this->setError(JText::_('JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN'));
			return true;
		}
		$retval = false;
		$php_errormsg = 'Error Unknown';
		$track_errors = ini_get('track_errors');
		ini_set('track_errors', true);
		switch($this->processingmethod)
		{
			case 'gz':
				$res = gzclose($this->_fh);
				break;
			case 'bz':
				$res = bzclose($this->_fh);
				break;
			case 'f':
			default:
				$res = fclose($this->_fh);
				break;
		}
		if (!$res) {
			$this->setError($php_errormsg);
		}
		else {
			$this->_fh = null;
			$retval = true;
		}
		if ($this->_openmode[0] == 'w') {
			$this->chmod();
		}
		ini_set('track_errors', $track_errors);
		return $retval;
	}
function close ( ) { if ( ! $ this -> _fh ) { $ this -> setError ( JText :: _ ( 'JLIB_FILESYSTEM_ERROR_STREAMS_FILE_NOT_OPEN' ) ) ; return true ; } $ retval = false ; $ php_errormsg = 'Error Unknown' ; $ track_errors = ini_get ( 'track_errors' ) ; ini_set ( 'track_errors' , true ) ; switch ( $ this -> processingmethod ) { case 'gz' : $ res = gzclose ( $ this -> _fh ) ; break ; case 'bz' : $ res = bzclose ( $ this -> _fh ) ; break ; case 'f' : default : $ res = fclose ( $ this -> _fh ) ; break ; } if ( ! $ res ) { $ this -> setError ( $ php_errormsg ) ; } else { $ this -> _fh = null ; $ retval = true ; } if ( $ this -> _openmode [ 0 ] == 'w' ) { $ this -> chmod ( ) ; } ini_set ( 'track_errors' , $ track_errors ) ; return $ retval ; }
Attempt to close a file handle
 Will return false if it failed and true on success
 @note: If the file is not open the system will return true
 @note: this function destroys the file handle as well
Attempt to close a file handle Will return false if it failed and true on success @note : If the file is not open the system will return true @note : this function destroys the file handle as well
// Capture PHP errors // reset this // If we wrote, chmod the file after it's closed // Restore error tracking to what it was before // Return the result