def isdir(path): return exists(path) and stat.S_ISDIR(ndsos.stat(path)[0])
def isfile(path): return exists(path) and stat.S_ISREG(ndsos.stat(path)[0])
def exists(path): try: ndsos.stat(path) except OSError: return False return True