[Tutor] os.access unreliable?

Albert-Jan Roskam fomcl at yahoo.com
Wed Aug 25 10:28:47 CEST 2010


Hi,

Hi I'm using os.access to do a preliminary check to see if I have RW access, but 
it seems to be unreliable. In a dir for which I have only read access, os.access 
also says I have write access. This is under Windows 2000. I could of course use 
a try-except and catch the IOError, but I'd like to know why the code below 
isn;t working.

    def isAcccessible(self):
        if os.access(self.path, os.R_OK) and os.access(self.path, os.W_OK):
            return True
        else:
            return False
 Cheers!!
Albert-Jan 


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All right, but apart from the sanitation, the medicine, education, wine, public 
order, irrigation, roads, a fresh water system, and public health, what have the 
Romans ever done for us?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 


      
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/tutor/attachments/20100825/3a660844/attachment.html>


More information about the Tutor mailing list