from pathlib import Path p = Path('.cache') print('path', p) print('exists', p.exists()) try: st = p.stat() print('mode', oct(st.st_mode & 0o777)) print('uid', st.st_uid, 'gid', st.st_gid) except Exception as e: print('error', e)