In Python on Windows, is there a way to determine if a user has permission to access a directory? I took a look at os.access , but it gives false results.
>>> os.access('C:\haveaccess', os.R_OK) False >>> os.access(r'C:\haveaccess', os.R_OK) True >>> os.access('C:\donthaveaccess', os.R_OK) False >>> os.access(r'C:\donthaveaccess', os.R_OK) True
Am I doing something wrong? Is there a better way to check if a user has permission to access a directory?
python windows directory permissions
Sean Feb 11 '09 at 22:26 2009-02-11 22:26
source share