protected function writeFile($filename, array $dataset)
    {
        // Assume fail
        $result = false;

        // Get getMetaComponents on file to write binary ...
        $fileHandle = @fopen($filename, 'wb');

        if (!$fileHandle) {
            throw new Doozr_Cache_Service_Exception(
                sprintf('Can\'t access "%s" to store cache data. Check access rights and path', $filename)
            );
        }

        // File locking (exclusive lock)
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_EX);
        }

        $result = (fwrite($fileHandle, implode(PHP_EOL, $dataset)) !== false);

        // Remove file-lock
        if ($this->getLocking() === true) {
            flock($fileHandle, LOCK_UN);
        }

        // close getMetaComponents
        fclose($fileHandle);

        return $result;
    }