Python - difference between os.access and os.path.exists?

Viewed 4131
def CreateDirectory(pathName):
    if not os.access(pathName, os.F_OK):
        os.makedirs(pathName)

versus:

def CreateDirectory(pathName):
    if not os.path.exists(pathName):
        os.makedirs(pathName)

I understand that os.access is a bit more flexible since you can check for RWE attributes as well as path existence, but is there some subtle difference I'm missing here between these two implementations?

2 Answers
Related