From 7d6753042f9cc490322a14e6d98dc40eab022fed Mon Sep 17 00:00:00 2001 From: krateng Date: Tue, 19 Dec 2023 18:50:22 +0100 Subject: [PATCH] Simplify permission check, GH-313 --- maloja/pkg_global/conf.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/maloja/pkg_global/conf.py b/maloja/pkg_global/conf.py index 26ff692..0d404fd 100644 --- a/maloja/pkg_global/conf.py +++ b/maloja/pkg_global/conf.py @@ -29,9 +29,7 @@ pthj = os.path.join def is_dir_usable(pth): try: os.makedirs(pth,exist_ok=True) - os.mknod(pthj(pth,".test")) - os.remove(pthj(pth,".test")) - return True + return os.access(pth,os.W_OK) except Exception: return False @@ -322,6 +320,7 @@ for identifier,path in data_directories.items(): else: print("Directory",path,"is not usable.") print("Please change permissions or settings!") + print("Make sure Maloja has write and execute access to this directory.") raise