def mkdtemp(suffix='', prefix=template, dir=None):
 if (dir is None):
  dir = gettempdir()
 names = _get_candidate_names()
 for seq in xrange(TMP_MAX):
  name = names.next()
  file = _os.path.join(dir, ((prefix + name) + suffix))
  try:
   _os.mkdir(file, 448)
   return file
  except OSError as e:
   if (e.errno == _errno.EEXIST):
    continue
   raise
 raise IOError, (_errno.EEXIST, 'No usable temporary directory name found')

def mkdtemp ( suffix = '' , prefix = template , dir = None ) : if ( dir is None ) : dir = gettempdir ( ) names = _get_candidate_names ( ) for seq in xrange ( TMP_MAX ) : name = names . next ( ) file = _os . path . join ( dir , ( ( prefix + name ) + suffix ) ) try : _os . mkdir ( file , 448 ) return file except OSError as e : if ( e . errno == _errno . EEXIST ) : continue raise raise IOError , ( _errno . EEXIST , 'No usable temporary directory name found' )
user-callable function to create and return a unique temporary directory .