perldoc File::Path
NAME
File::Path - create or remove directory trees
SYNOPSIS
use File::Path;
mkpath(['/foo/bar/baz', 'blurfl/quux'], 1, 0711);
rmtree(['foo/bar/baz', 'blurfl/quux'], 1, 1);
DESCRIPTION
The "mkpath" function provides a convenient way to create directories, even if your "mkdir" kernel call won't create more than one
level of directory at a time. "mkpath" takes three arguments:
mkpath 函数提供了便利的方式来创建目录,提供了3个参数
? the name of the path to create, or a reference to a list of paths to create,
要创建的路径名字,或者相关的一系列路径
? a boolean value, which if TRUE will cause "mkpath" to print the name of each direc
Perl File::Path 模块
最新推荐文章于 2023-12-26 11:42:45 发布
Perl的File::Path模块提供mkpath和rmtree函数,用于创建和删除目录树。mkpath可以创建多级目录,rmtree类似Unix的`rm -r`,用于删除子目录树。这两个函数都接受三个参数,分别用于指定路径、是否显示操作信息和权限检查。在使用rmtree时需要注意可能存在的安全性问题和竞态条件。
摘要由CSDN通过智能技术生成