可以Ant的递归CHMOD以exec在速度方面的竞争? [英] Can Ant's recursive chmod compete with exec in terms of speed?

查看:179
本文介绍了可以Ant的递归CHMOD以exec在速度方面的竞争?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的build.xml递归chmod和借用的这个帖子

I want to chmod recursively in my build.xml and borrowed the following from this post:

<chmod file="${basedir}/foo/**" perm="755" type="both"/>

它的令人难以置信的慢,因为该目录深,包括大量的文件。

It's unbelievably slow since that directory is deep and includes a large number of files.

这工作得更好和放大器;速度快:

This works much better & faster:

<exec executable="chmod" dir="${basedir}/foo" failonerror="true">
    <arg line="-R 0755 ." />
</exec>


  • 有没有使用任何缺点 EXEC 速度是很重要的。

  • 如果是的; 我使用搭配chmod 正确?

  • 推荐答案

    Exec的是更快,因为搭配chmod任务收集的所有文件,然后chmod'ng他们。以exec这是一个操作。唯一的缺点,以使用EXEC是,它关系到你的UNIX / Linux。我使用引号是因为搭配chmod任务不会运行在Windows反正,所以这是一个有争议的问题。

    Exec is faster because the chmod task is gathering all the files and then chmod'ng them. With exec it is one operation. The only "downside" to using exec is that it ties you to UNIX/Linux. I use quotes because the chmod task doesn't run on Windows anyway so this is a moot point.

    您是否正确使用,并都以exec去是有道理的。

    You are using both correctly and going with exec makes sense.

    这篇关于可以Ant的递归CHMOD以exec在速度方面的竞争?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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