Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #5785

Re: os.access giving incorrect results on Windows

Date 2011-05-19 21:08 +0100
From Tim Golden <mail@timgolden.me.uk>
Subject Re: os.access giving incorrect results on Windows
References <21581D39FA3BDF40904D75AF9653CE2606567E4A@blrex.prog.altair.com> <4DD572FB.2010809@timgolden.me.uk> <4DD575E1.9060801@gmail.com>
Newsgroups comp.lang.python
Message-ID <mailman.1800.1305835712.9059.python-list@python.org> (permalink)

Show all headers | View raw


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 affect just os.W_OK and directories or all of os.access()?
>
> In any case, this information should really be reflected in the docs.

The current code is very naive:

* A R_OK check always succeeds if the file's attributes can be read
   at all
* A W_OK check fails if the file has its DOS read-only attribute set
* A W_OK check always succeeds for a directory (because read-only means
   something else for directories).

Would you care to propose some wording for the docs? I'm quite happy
to commit if we can come to an agreement.

TJG

Back to comp.lang.python | Previous | Next | Find similar | Unroll thread


Thread

Re: os.access giving incorrect results on Windows Tim Golden <mail@timgolden.me.uk> - 2011-05-19 21:08 +0100

csiph-web