ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Re: building a fileset with specific permissions?
Date Thu, 07 Jun 2001 15:14:11 GMT

----- Original Message -----
From: "Mark Ashton" <mashton@Novarra.com>
To: <ant-user@jakarta.apache.org>
Sent: Friday, June 08, 2001 12:21 AM
Subject: RE: building a fileset with specific permissions?


> Well, I thought I had found a rather clever way to do this:
>
>   <target name = "beautify" description =
>     "Cleans up line feeds and tabs if you are in cygwin" >
>     <!-- find the writable source files so we don't chmod them back to
>          read-only -->
>     <exec executable = "find" output = "writable_source_files">
>         <arg line = "-perm 644 -name *.java"/>
>     </exec>
>     <chmod dir = "${src.dir}" perm = "+w"/>
>     <fixcrlf srcDir = "${src.dir}" cr = "${carriageReturn}" tab =
"${tabs}"
>         tablength = "${tablength}" />
>     <chmod dir = "${src.dir}" perm = "-w" excludesfile =
>         "writable_source_files" />
>     <delete file = "writable_source_files" />
>   </target>
>
> Unfortunately, it seems the exec command is complaining, and that the
chmod
> is not working. Does this mean that despite the fact that I am running
under
> cygwin, any sort of commands exec'ed from ant will be executed in a DOS
> environment?
>

You are not really running "under" cygwin. Cygwin launches the Windows
version of the JDK and Ant runs in this environment. The chmod task,
therefore will have no effect, since it detects the os and operates
accordingly. I'm not sure about the find command. I guess that the find
command from Cygwin expects the shell to perform wildcard expansion. Ant's
exec task does not do this.

Conor



Mime
View raw message