Back to Stream class

Method writeFile

public bool
writeFile
(mixed $filename, mixed &$buffer)
Writes a chunk of data to a file.
Parameters
  • string $filename The file name.
  • string $buffer The data to write to the file.
Returns
  • bool
Since
  • 1.7.0
Class: Stream
Project: Joomla

Method writeFile - Source code

/**
 * Writes a chunk of data to a file.
 *
 * @param   string  $filename  The file name.
 * @param   string  $buffer    The data to write to the file.
 *
 * @return  boolean
 *
 * @since   1.7.0
 */
public function writeFile($filename, &$buffer)
{
    if ($this->open($filename, 'w')) {
        $result = $this->write($buffer);
        $this->chmod();
        $this->close();
        return $result;
    }
    return false;
}