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

Matt Gerrans mgerrans at mindspring.com
Tue Jun 17 09:05:50 CEST 2003


I thought that the the stat module was supposed to help for this kind of
thing, eg.:

os.chmod( filename, stat.S_IREAD )

Or was I just fooled because it looks plausible?    It *seems* to do the
right thing.

Anyway, I have found that to full and reliable usage of file attributes in
Windows, it is necessary to shift to the platform-specific route an and use
the win32file module (GetFileAttributes(), SetFileAttributes(), plus
win32con's FILE_ATTRIBUTE_* constants).

- Matt







More information about the Python-list mailing list