I'm using Python 2.7.9 under Debian GNU/Linux 8 (jessie) 64-bit. I just tried to change file attributes by calling os.chflags(path, mode). In the Python docs there is an article about the os interface which says that this method is available in Unix, but it doesn't work for Linux. Python always throws:
Traceback (most recent call last):
File "/home/lexer/py/epam/tests/main.py", line 43, in <module>
os.chflags(path_to_file(file_name), stat.SF_NOUNLINK)
AttributeError: 'module' object has no attribute 'chflags'
There is an issue which was already raised for that a long time ago, but I still can't understand why os.chflags() doesn't do the chattr command's job. Could anybody elaborate it?
os.__file__says.