OT - file permission checks on Windows

Bengt Richter bokr at oz.net
Mon Mar 4 17:34:16 EST 2002


On Mon, 4 Mar 2002 14:32:12 -0600, Skip Montanaro <skip at pobox.com> wrote:

>
>    >> Is the permission model there even remotely similar to what I'm used
>    >> to on Unix systems?
>
>    Thomas> No, I don't think so.
>
>I was afraid of that.
>
>    >> I poked around posixmodule.c, but it makes next to no use of uids and
>    >> gids.  As far as I can tell, Windows doesn't know about uid_t or
>    >> gid_t, though it has a struct _stat type whose st_uid and st_gid
>    >> fields are shorts, so I can work around the missing types.
>
>    Thomas> st_uid and st_gid are always set zo zero under Win NT:
>    Thomas> http://msdn.microsoft.com/library/en-us/vclib/html/_crt__stat.2c_._wstat.2c_._stati64.2c_._wstati64.asp
>
>Thanks for the pointer.  This takes me someplace weird in the msdn website,
>most likely because I'm using Opera instead of MSIE.  I'll have to fiddle
>with that a bit I think.
>
>    Thomas> Are you maybe looking for the _access function?
>    Thomas> http://msdn.microsoft.com/library/en-us/vclib/html/_crt__access.2c_._waccess.asp
>
>Perhaps.  On Unix, definitely not.
>
Maybe have a look at GetFileSecurity & related, which is supported by NT (not 95/98).
It'll lead you to security descriptor info etc. Find it via MSVC++6 help>Index... and
type GetFileSecurity in the slot. There's a lot of 'see also' and other functions in the group.

Maybe Mark Hammond knows of some real python experience with it. (I don't).
HTH

Regards,
Bengt Richter






More information about the Python-list mailing list