删除gulp文件中的windows文件只读属性 [英] Remove windows file readonly attribute in gulp file

查看:195
本文介绍了删除gulp文件中的windows文件只读属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



更新
如何从Windows中的文件夹下的所有文件中删除只读属性?关于如何使用gulpfile删除readonly属性

解决方案

我找到了答案:

要以递归方式移除目录下所有文件的只读属性,我们在Windows中运行以下命令命令行

  attrib -r< dir-name> \ *。* / s 

遵循gulp任务删除只读属性/ b>

  gulp.task('remove-readonly-attributes',function(){
require( child_process)。exec(attrib -r< dir-name> \ *。* / s);
});


How can we remove readonly attribute from all files under a folder in Windows?

UPDATE: The question is more about how to remove readonly attribute using gulpfile

解决方案

I figured out the answer:

To remove readonly attribute of all files under a directory recursively, we run the following command in windows Command line

attrib -r <dir-name>\*.* /s

Following gulp task removes readonly attribute of all files under

gulp.task('remove-readonly-attributes', function() {
    require("child_process").exec("attrib -r <dir-name>\*.* /s");
});

这篇关于删除gulp文件中的windows文件只读属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆