Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python os.chflags() Method
Description:
This method sets the flags of path to the numeric flags. The flags may take a combination (bitwise OR) of the various values described below.
Note: This method is available Python version 2.6 onwards. Most of the flags can be changed by super-user only.
Syntax:
Parameters:
Here is the detail of parameters:
Example:
#!/usr/bin/python
import os
path = "/tmp/foo.txt"
# Set a flag so that file may not be renamed or deleted.
flags = os.SF_NOUNLINK
retval = os.chflags( path, flags)
print "Return Value: %s" % retval
|
This produces following result:
|
|
|