Skip to content

Maintenance Ruby 3.3 gets fixes, but no new features. Switch to Ruby 4.0 →

class method

Dir.chroot

Dir.chroot(dirpath) → 0

Changes the root directory of the calling process to that specified in dirpath. The new root directory is used for pathnames beginning with '/'. The root directory is inherited by all children of the calling process.

Only a privileged process may call chroot.

See Linux chroot.

See also .children .delete .chdir .each_child also in 4.1 · 4.0 · 3.4 · 3.2 · 3.1 · 3.0