Re: os.access giving incorrect results on Windows

2011-05-24 Thread Tim Golden
On 20/05/2011 12:26, Ayaskanta Swain wrote: > Thanks for the reply and suggestions. I followed the patch provided by > you in issue 2528, but the code looks very tricky to me. OK, first a summary of the discussion on the python-dev thread. Essentially it was felt that os.access was sufficiently s

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Ayaskanta Swain
Hi Tim, Thanks for the reply and suggestions. I followed the patch provided by you in issue 2528, but the code looks very tricky to me. Anyways I wrote my Test.py script & tried only the def test_access_w(self): test case which is defined under class FileTests(unittest.TestCase) by providing my

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 20/05/2011 09:21, Tim Golden wrote: [... re os.access on Windows ...] (Sorry; just got back to this this morning). I might raise this on python-dev. If you want to follow, my post is here: http://mail.python.org/pipermail/python-dev/2011-May/111530.html TJG -- http://mail.python.org/ma

Re: os.access giving incorrect results on Windows

2011-05-20 Thread Tim Golden
On 19/05/2011 21:40, Andrew Berg wrote: On 2011.05.19 03:08 PM, Tim Golden wrote: * A R_OK check always succeeds if the file's attributes can be read at all So is this the same as F_OK then, or does it return false if the user isn't allowed to read permissions? * A W_OK check fails if the

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Andrew Berg
On 2011.05.19 03:08 PM, Tim Golden wrote: > * A R_OK check always succeeds if the file's attributes can be read >at all So is this the same as F_OK then, or does it return false if the user isn't allowed to read permissions? > * A W_OK check fails if the file has its DOS read-only attribute set

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Tim Golden
On 19/05/2011 20:56, Andrew Berg wrote: On 2011.05.19 02:43 PM, Tim Golden wrote: This is basically issue2528 [1]. The problem is that, although Windows (and Python) expose a version of os.access to match the Posix function, the meaning is so far removed on Windows as to be useless. Does this a

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Andrew Berg
On 2011.05.19 02:43 PM, Tim Golden wrote: > This is basically issue2528 [1]. > The problem is that, although Windows (and Python) > expose a version of os.access to match the Posix function, > the meaning is so far removed on Windows as to be useless. Does this affect just os.W_OK and directories o

Re: os.access giving incorrect results on Windows

2011-05-19 Thread Tim Golden
On 19/05/2011 20:37, Ayaskanta Swain wrote: Please help me in solving this issue. I want to check the write permissions on a directory on windows from my python script. I tried to use *os.access(dirpath, os.W_OK)*to check whether the user has write access or not, but it gives me incorrect result

os.access giving incorrect results on Windows

2011-05-19 Thread Ayaskanta Swain
Hi All, Please help me in solving this issue. I want to check the write permissions on a directory on windows from my python script. I tried to use os.access(dirpath, os.W_OK) to check whether the user has write access or not, but it gives me incorrect result. It always gives me False even