The method chroot() changes the root directory of the current process to the given path.To use this method, you would need super user privilege.
Following is the syntax for chroot() method ?
This method does not return any value.
The following example shows the usage of chroot() method.
import os, sys
# To set the current root path to /tmp/user
print "Changed root path successfully!!"
When we run above program, it produces following result ?
Changed root path successfully!!