Reading the access attributes of directories in Windows

Tim Golden mail at
Thu Aug 19 20:55:38 CEST 2010

On 19/08/2010 4:55 PM, vsoler wrote:
> I need to read, for each of the directories in a shared file server
> unit, who has access to the directories and what type of access
> privileges.
> This is something that I can easily do interactively in my Windows
> Document Explorer by right clicking a single directory, clicking on
> Properties, then on Security.
> There I can see the Users and Group of Users that have access to the
> selected directory, as well as the type of access to that directory
> (Read/Write/eXecute etc.)

Here you have one of those occasions when the Windows GUI does
a very good job of presenting a simplified but perfectly usable
interface layer on top of a moderately complex security scheme.

It's not as easy as you think.

> I've been looking in the "os" library, and found the "os.chmod" method
> but I am not sure that it is going to give me what I need. Should I
> also used library "stat"?

No. Both of these are basically doing a best-endeavours job of mapping
certain Windows attributes to some Posix equivalent. They're essentially
useless for anything beyond the most trivial tasks.

Have a read here which will at least put you on the path of knowing
what terminology you need to search for:

and if you're interested, this is the kind of thing my winsys
package is reasonably good at:


More information about the Python-list mailing list