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


Groups > comp.lang.python > #5785 > unrolled thread

Re: os.access giving incorrect results on Windows

Started byTim Golden <mail@timgolden.me.uk>
First post2011-05-19 21:08 +0100
Last post2011-05-19 21:08 +0100
Articles 1 — 1 participant

Back to article view | Back to comp.lang.python

This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by below is the oldest one visible, not the original post.


Contents

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

#5785 — Re: os.access giving incorrect results on Windows

FromTim Golden <mail@timgolden.me.uk>
Date2011-05-19 21:08 +0100
SubjectRe: os.access giving incorrect results on Windows
Message-ID<mailman.1800.1305835712.9059.python-list@python.org>
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

[toc] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web