ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Dick, Brian E." <Brian.D...@FMR.com>
Subject RE: Loadfile not loading file
Date Wed, 18 Aug 2004 13:31:20 GMT
log.txt contains the string ERROR
<echo message="${log.property}"/> displays "${log.property}" (it's not set)
<echo message="${log.error}"/> displays "${log.error}" (it's not set)

You can test the code below with a minor change. Replace the exec task with

<echo message="ERROR"/>

-----Original Message-----
From: Jan.Materne@rzf.fin-nrw.de [mailto:Jan.Materne@rzf.fin-nrw.de] 
Sent: Wednesday, August 18, 2004 9:21 AM
To: user@ant.apache.org
Subject: AW: Loadfile not loading file


Have you checked:
- the log.txt (using viewing into that)
- the log.property (using <echo>)
- the log.error (using <echo>)

Are their content what you are expecting?


Jan

> -----Urspr√ľngliche Nachricht-----
> Von: Dick, Brian E. [mailto:Brian.Dick@FMR.com]
> Gesendet am: Mittwoch, 18. August 2004 15:17
> An: user@ant.apache.org
> Betreff: Loadfile not loading file
> 
> I have an executable that does not set the exit code but does put
> "ERROR" in its stdout. I'm trying use the loadfile task to 
> load the file
> produced by the record task, but loadfile is not setting the property.
> Below is a simplified version of my code. Can someone tell me why this
> code doesn't work? Is there another way to accomplish this?
> 
>    <target name="myexec">
>       <record name="log.txt" action="start"/>
>       <exec executable="myexec"/>
>       <record name="log.txt" action="stop"/>
>       <loadfile property="log.property" srcfile="log.txt"/>
>       <condition property="log.error">
>          <contains string="${log.property}" substring="ERROR"/>
>       </condition>
>       <fail if="log.error"/>
>    </target>
> 
> ---------------------------------------------------------------------
> 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