Need function to test if EFFECTIVE UID has read-access to a file.

Skip Montanaro skip at pobox.com
Wed Nov 17 13:15:05 EST 2004


    Markus> Well, basically the title says it all. I can't use os.access()
    Markus> because it tests whether the REAL UID can read/write/exec the
    Markus> file. Surely there has to be a function that does what I need,
    Markus> but I can't seem to find it. Any input welcome.

try:
    f = open("somefile")
except IOError:
    print "file not readable"

Skip



More information about the Python-list mailing list