public function rm($sourcepath)
    {
        if ($sourcepath == '' || substr($sourcepath, 0, 1) !== '/') {
            $sourcepath = $this->dir . '/' . $sourcepath;
        }

        $this->errorHandler->start();
        //check the file actauly exists.
        if (($sourcepath = $this->driver->realpath($this->resource, $sourcepath)) !== false) {
            //file exists
            if ($this->driver->sftpDelete($this->resource, $sourcepath)) {
                //file deleted
                $this->errorHandler->stop();

                return true;
            } //file not deleted
        } //file does not exist.

        $this->errorHandler->stop();
        $this->errorHandler->register("Could not delete: $sourcepath", 0);

        return false;
    }