当前位置: 首页 > 文档资料 > Perl 入门教程 >

chroot

优质
小牛编辑
116浏览
2023-12-01

描述 (Description)

此函数的作用类似于系统调用的相同名称:它使命名目录成为所有其他路径名的新根目录,这些路径名以您的进程及其所有子进程开头。 出于安全原因,此函数与系统chroot()函数相同,仅限于超级用户,无法撤消。

如果省略了FILENAME,那么它会为$ _做一个chroot

语法 (Syntax)

以下是此函数的简单语法 -

chroot EXPR
chroot

返回值 (Return Value)

此函数在失败时返回0,在成功时返回1。

<!--

例子 (Example)

Following is the example code showing its basic usage −

#!/usr/bin/perl

When above code is executed, it produces the following result −

-->