views:

46

answers:

1

I'd like to do the equivalent of a chmod -R +w foo/ in an Ant build script.

So far I'm using this:

<chmod perm="g+w">
   <dirset dir="${basedir}/foo">
   </dirset>
   <fileset dir="${basedir}/foo">
   </fileset>
</chmod>

Is there a neater way to write that to include files and folders recursively?

+1  A: 

The following does work:

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

Credits shared with the OP.

See also

Pascal Thivent
@Wernight: The `type="both"` has to be used with `file=`. But the key was indeed the use of the `**`.
Pascal Thivent