Possible bug in setting Windows file permissions? (os.chmod() not working properly?)

Tim Peters tim.one at comcast.net
Mon Jun 16 20:13:28 EDT 2003


[Matthew Shomphe]
> Bloody hell, you're right!  I didn't think that UNIX file
> permission descriptions would work in Windows, but they do.

Sometimes they do, and provided you stick to things that also make sense on
Windows (e.g., the "execute" bit doesn't mean beans on Windows, or, in the
other direction, the Windows "hidden" bit has no spelling via chmod).

> Can someone make this clearer in the documentation?

You're elected <0.5 wink>.  Start by doing a google search on

    _chmod msdn

The top hit will take you to MS's docs for MS's implementation of chmod
(which Python calls).

> It's interesting to note that '666' maps into '33206' in the
> Windows file permission description.  So you can (apparently), use
> both values to make a file readable & writeable.

One of many undocumented mysteries.  This one isn't too surprising:

>>> oct(33206)
'0100666'
>>>






More information about the Python-list mailing list