我需要清除在Windows上运行的Perl程序中的文件的只读标志。如何清除Perl中的文件的只读标志?
我知道3210会工作,但我想知道是否没有在Perl中的内置选项来做到这一点。 chmod 777, $filename
似乎不起作用。
感谢,
splintor
我需要清除在Windows上运行的Perl程序中的文件的只读标志。如何清除Perl中的文件的只读标志?
我知道3210会工作,但我想知道是否没有在Perl中的内置选项来做到这一点。 chmod 777, $filename
似乎不起作用。
感谢,
splintor
尝试chmod 0777, $filename
。您需要使用八进制表示法的权限。
处理这类事情的最常见方式的确与chmod
。我可以使用删除只读标志成功如下:
chmod 0777, $filename;
这是使用chmod
的octal notation。
我在Windows Vista 64位上使用Strawberry Perl 5.8.8。
区别在于你添加了一个零 - 0777,并且我使用了777,这不起作用。 – splintor 2009-01-18 05:52:26
缺少0这个技巧,谢谢! – splintor 2009-01-15 07:51:01