ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter Reilly <peterrei...@apache.org>
Subject Re: How does <exec> interpret an empty output property
Date Wed, 10 Nov 2004 13:32:28 GMT
The exec task does not process the string. Ant's core code
converts the string to a File object  - in this case an empty string
will get converted to the base dir.

So with:
<project default="t">
  <target name="t">
    <exec executable="ls" output=""/>
  </target>
</project>
one gets:
/home/preilly/learning/a/exec/build.xml:3: Execute failed: 
java.io.FileNotFoundException: /home/preilly/learning/a/exec (Is a 
directory)

One may one the ant-contribs's <if/> task to implement the logic.

Peter
sten.rosendahl@sungard.com wrote:

>Hi,
>
>I have a macrodef passing on a logfile attribute to exec's output
>property. If I want as default to have no logfile, how do write this in
>the macrodef? The easiest logic for me would be if output="" means no
>redirection as I then could use <attribute name="logfile" default=""/>.
>
>Sten Rosendahl
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message