当我调用 make_path
(从核心 File::Path
模块提供模式时,创建的目录没有我请求的模式:
$ perl -MFile::Path=make_path -e 'make_path("foobar", { mode=>0770 });'
$ ls -ld foobar/
drwxr-x--- 2 itk itkadm 4096 Sep 19 11:10 foobar/
我期待看到:
drwxrwx--- 2 itk itkadm 4096 Sep 19 11:07 foobar/
最佳答案
而不是将目录的权限设置为0
。尝试仅使用 File::Path::make_path
chmod
选项
perl -MFile::Path=make_path -e 'make_path("foobar", { chmod=>0770 });'
关于perl - make_path 未按指定设置模式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25924878/