'mktemp(prefix) ->  <temp_dir or basedir>/<subdir>/prefix.<rand>
Return a unique temporary filename with prefix in the cluster\'s temp dir.'

@_coerce_exceptions
def mktemp(self, subdir='', prefix='tmp', basedir=None):

    RANDOM_BITS = 64
    base = self.join((basedir or self._temp_dir), subdir)
    if (not self.isdir(base)):
        self.mkdir(base)
    while True:
        name = ((prefix + '.') + str(random.getrandbits(RANDOM_BITS)))
        candidate = self.join(base, name)
        if (not self.exists(candidate)):
            return candidate
