Jump to content

Perl Programming/Keywords/chroot

From Wikibooks, open books for an open world
Previous: chr Keywords Next: close

The chroot keyword

[edit | edit source]

chroot works like the same system call on UNIX, by changing root directory for all pathnames that start with a / and all of its children to FILENAME. This system call can only be run by the superuser. Without FILENAME, the contents of $_ are used.

Syntax

[edit | edit source]
  chroot FILENAME
  chroot

Examples

[edit | edit source]
  chroot $filename;
  chroot /usr
Previous: chr Keywords Next: close