Possible bug in setting Windows file permissions? (os.chmod() not working properly?)
Matt Shomphe
MatthewS at HeyAnita.com
Mon Jun 16 19:17:41 EDT 2003
I noticed an error when trying to change the file permissions for a
file on a Windows (2K) machine. I'm using David Beazley's excellent
"Python Essential Reference, 2nd. Ed." as a reference. According to
the book (p. 186 for those following along at home), it should be used
thusly:
import os
os.chmod('myReadOnlyFile.txt', os.O_RDWR)
Where for os.O_RDWR, you could have any of the modes specified on p.
184. In other words, all the same bitwise-or modes for opening a
file. What happens with the above code is: nothing at all. However,
the following code *will* work to change a file to be accessible:
import os
os.chmod('myReadOnlyFile.txt', 33206)
So, either I am using the os.chmod() function incorrectly, or there is
something wrong elsewhere.
Any hints on what's to be done?
M@
More information about the Python-list
mailing list