我想在我的build.xml文件中递归地使用chmod命令,并从这篇文章中借鉴了以下内容:
<chmod file="${basedir}/foo/**" perm="755" type="both"/>
由于该目录较深且包含大量文件,因此速度非常慢。
这个方案更加高效、更快:
<exec executable="chmod" dir="${basedir}/foo" failonerror="true">
<arg line="-R 0755 ." />
</exec>
- 使用
exec
有什么缺点吗? 速度很重要。 - 如果有的话;我是否错误地使用了
chmod
?
chmod
-- 但是这也可以在exec
中轻松解决。你会使用chmod
做什么吗? :) - chelmertz