function getPwd($file) {
        $root = $this->dirroot;
        $path = realpath(dirname($file));
        $root .= '/'; // Add the trailing slash
        if ( strlen($path) < strlen($root) ) return false;
        // The root must be the prefix of path
        if ( strpos($path, $root) !== 0 ) return false;
        $retval = substr($path, strlen($root));
        return $retval;
    }