os.access() under windows

"Martin v. Löwis" martin at v.loewis.de
Tue Dec 4 11:02:17 EST 2007


> Martin. Could you confirm that the outline below correctly
> describes the behaviour of the os.access function under
> Windows, please?

It's correct for Python 2.5.2 and 2.6; for 2.5.1 (as discussed)
the test "if directory:return True" was not implemented.

Notice that the first sentence:

"If the path does not exist or if access if forbidden, return False"

is confusing. It seems to say "access() returns false if access is
forbidden". I think you are referring to the directory (in the sense
of os.path.dirname) of the path to be tested.

> Agreed. I think I'd like to see that happen, but I have to
> down several strengthening drinks every time I approach the
> Windows Security API!

There is a good tutorial example in the AccessCheck documentation.
If you leave out the impersonation part, it should be
straight-forward to apply this to Python. Contributions are
welcome.

Regards,
Martin



More information about the Python-list mailing list