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