gpt4 book ai didi

perl - make_path 未按指定设置模式

转载 作者:行者123 更新时间:2023-12-01 19:26:51 36 4
gpt4 key购买 nike

当我调用 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/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com