HartyBart opened this issue on Sep 08, 2021 ยท 7 posts
adp001 posted Fri, 10 September 2021 at 1:22 AM
Use os.access(...) to check if the user is allowed to read/write that file:
if os.access(os.R_OK) ... # read ok
if os.access(os.W_OK) ... # write ok
if os.access(os.R_OK | os.W_OK) ... # read and write ok
https://docs.python.org/2.7/library/os.html#os.access