ID EN
Pathlib

chmod

Python 3.11

Change the file mode and permissions, like os.chmod().

Syntax

PYTHON
Path.chmod(mode, *, follow_symlinks=True)

Examples

Example 1
PYTHON
>>> p = Path('setup.py')
>>> p.stat().st_mode
33277
>>> p.chmod(0o444)
>>> p.stat().st_mode
33060

See Also

os.chmod() lchmod()