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

def mkswap(self, filename, subdir='', suffix='swp', basedir=None):

    RANDOM_BITS = 64
    base = self.join((basedir or self._temp_dir), subdir)
    if (not self.isdir(base)):
        self.mkdir(base)
    candidate = self.join(base, ('%s.%s' % (filename, suffix)))
    return candidate
