def create_all_dirs(path, umask=False):
 result = True
 if sabnzbd.WIN32:
  try:
   os.makedirs(path)
  except:
   result = False
 else:
  lst = []
  lst.extend(path.split('/'))
  path = ''
  for d in lst:
   if d:
    path += ('/' + d)
    if (not os.path.exists(path)):
     try:
      os.mkdir(path)
      result = True
     except:
      result = False
     if umask:
      mask = cfg.umask()
      if mask:
       try:
        os.chmod(path, (int(mask, 8) | 448))
       except:
        pass
 return result

def create_all_dirs ( path , umask = False ) : result = True if sabnzbd . WIN32 : try : os . makedirs ( path ) except : result = False else : lst = [ ] lst . extend ( path . split ( '/' ) ) path = '' for d in lst : if d : path += ( '/' + d ) if ( not os . path . exists ( path ) ) : try : os . mkdir ( path ) result = True except : result = False if umask : mask = cfg . umask ( ) if mask : try : os . chmod ( path , ( int ( mask , 8 ) | 448 ) ) except : pass return result
create all required path elements and set umask on all return true if last element could be made or exists .