Python Basics
Python Advanced
Python Useful References
Python Useful Resources
Selected Reading
© 2011 TutorialsPoint.COM
|
Python os.chroot() Method
Description:
This method changes the root directory of the current process to the given path.
To use this method, you would need super user privilege.
Syntax:
Parameters:
Here is the detail of parameters:
Example:
#!/usr/bin/python
import os, sys
# To set the current root path to /tmp/user
os.chroot("/tmp/usr")
print "Changed root path successfully!!"
|
This produces following result:
Changed root path successfully!!
|
|
|
|