It seems os.chmod(path, stat.S_IWSUR) only works for file. Is it a known bug? How can I chmod for a whole folder including its content?
Asked
Active
Viewed 401 times
1 Answers
0
os.chmod
is not intended to replicate all features of the chmod
shell command; it's more like the chmod
system call. Particularly, like the system call and unlike the shell command, it doesn't support a recursive chmod; you'd have to do that yourself with something like os.walk
.
You can os.chmod
a directory, but it won't chmod the directory's contents.

user2357112
- 260,549
- 28
- 431
- 505