public static function randomdir($where, $prefix = '', $suffix = '') {
        global $CFG;

        $dirname    = false;
        $randomname = self::uuidgen($prefix, $suffix, false);
        $newdirname = $where.DIRECTORY_SEPARATOR.$randomname;
        if (mkdir($newdirname)) {
            chmod($newdirname, $CFG->directorypermissions);
            $dirname = $randomname;
        }
        return $dirname;
    }