INNER CODE UNIT · Python

IsAdmin

loxy0devlp/RedTiger-Tools · Config/Utils.py:166

def IsAdmin():
    if os_name == "Windows":
        try: return ctypes.windll.shell32.IsUserAnAdmin() != 0
        except: return False
    elif os_name == "Linux":
        try: return os.geteuid() == 0
        except: return False

def RunSpeed(state, ctx, json_data, keys, func):
    result = func()
    *values, json_format = result
    for k, v in zip(keys, values): ctx[k] = v
    MergeJson(json_data, json_format)
    state["completed"] += 1

def StatsPressed(state, time_start=None):
    global thread_status
    if os_name == "Linux" and not IsAdmin():

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…