File and directory permissions in windows

Tim Golden tim.golden at viacom-outdoor.co.uk
Mon Oct 23 11:13:22 EDT 2006


[ismael]

| I have some problems to get the the permissions on windows. I 
| use a simple code that run perfectly in UNIX but give me wrong 
| information on Windows. I found this code searching by google:

[... snip ...]

| is there a solution for this?, another library or code? 
| Anything that i do wrong?

Well, I'm certainly feeling guilty, because I've had a
note on my TODO list since the last time this came up
a month or so ago.

In short, Windows doesn't really map the read/write/exec
Posix model especially logically. AFAICT, the MS CRT code
doesn't take account of NT permissions or things like PATHEXT
at all -- which would give you non-readable or executable. 
The traditional DOS model only supports read-only 
(and hidden/system/archived which don't apply here) so
there's no way, eg, for any combination of flags to indicate
can't-read-at-all.

In short, *I* need to provide that doc patch I got halfway
through, and *you* need to find a way around whatever you're
trying to do on Windows. Depending on what you're after, you
might end up with some sort of try-except framework, or using
the win32security module from the pywin32 extensions.

Feel free to post again indicating what you're trying to do
with the stat information.

TJG

________________________________________________________________________
This e-mail has been scanned for all viruses by Star. The
service is powered by MessageLabs. For more information on a proactive
anti-virus service working around the clock, around the globe, visit:
http://www.star.net.uk
________________________________________________________________________



More information about the Python-list mailing list