public function write($file, $data, $append = false, $create = true, $modeBoolean = true)
    {
        // Preprocessing
        $file = $this->_preProcess($file);

        // exception for the case that the file|folder isn't writable
        if (!$this->_is_resource_writable($file)) {
            throw new Doozr_Exception(
                'The file "'.$file.'" could not be written. Current operation failed. Check permissions.'
            );
        }

        // Decide which mode
        if ($append) {
            $result = $this->_append($file, $data, $create);
        } else {
            $result = $this->_rewrite($file, $data, $create);
        }

        // transform result?
        if ($modeBoolean) {
            $result = ($result !== false) ? true : false;
        }

        // return the result of operation
        return $result;
    }