If you want to make file read-only:
import os
from stat import S_IREAD
from stat import S_IREAD
os.chmod('path/to/file.txt', S_IREAD)
If you want to make file writeable:
import os
from stat import S_IWRITE
from stat import S_IWRITE
os.chmod('path/to/file.txt', S_IWRITE)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.