os.chmod()

os.chmod(path, mode, *, dir_fd=None, follow_symlinks=True)

Change the mode of path to the numeric mode. mode may take one of the following values (as defined in the stat module) or bitwise ORed combinations of them:

This function can support specifying a file descriptor, paths relative to directory descriptors and not following symlinks.

Note

Although Windows supports chmod(), you can only set the file’s read-only flag with it (via the stat.S_IWRITE and stat.S_IREAD constants or a corresponding integer value). All other bits are ignored.

New in version 3.3: Added support for specifying path as an open file descriptor, and the dir_fd and follow_symlinks arguments.

doc_python
2016-10-07 17:38:40
Comments
Leave a Comment

Please login to continue.