Windows and Linux compatible chmod
Project description
oschmod
Python chmod that works on Windows and Linux
With oschmod, on Windows and Linux, you can use stat modes (permissions) for files and directories. Python's os.chmod()
does not work properly on Windows, only setting the read-only bit.
For example, on Linux, you can easily give a file owner read, write, and execute permissions, and deny the group and others any permissions (i.e., equivalent of 700
). You can do it like:
import os
import stat
os.chmod('myfile', stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
Running the same command on Windows does not achieve the same results, such as the group and others are not denied permissions.
However, using oschmod you can use the same command on Windows or Linux and get the same results:
import oschmod
oschmod.set_mode('myfile', stat.S_IRUSR | stat.S_IWUSR | stat.S_IXUSR)
Installation
$ pip install oschmod
Changelog
0.1.0
Commit Delta: Change from 0.0.0 release
Released: 2020.04.15
Summary:
- Initial release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for oschmod-0.1.3-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | af0c435e35a8973858a0f4d32e5817899aa2124d7cab79ff7c982f18b08a4b55 |
|
MD5 | 667681d24f89e0499e4823c01330dbf8 |
|
BLAKE2b-256 | 4d4e476a1ea40194233f7f9d27f4322029ae8ffc4b1222800c1cf7dca2d508f3 |