Perl mkdir 函数
描述
This function makes a directory with the name and path EXPR using the mode specified by MODE, which should be supplied as an octal value for clarity.
语法
以下是此函数的简单语法 −
mkdir EXPR,MODE
返回值
此函数在失败时返回 0,在成功时返回 1。
示例
以下是显示其基本用法的示例代码 −
#!/usr/bin/perl -w $dirname ="/tmp/testdir"; mkdir $dirname, 0755;
When above code is executed, it produces the following result in /tmp directory −
drwxr-xr-x 2 root root 4096 Sept 08 11:55 testdir