ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Chan, Eddy" <ec...@akamai.com>
Subject Specifying System.out as a file
Date Tue, 03 Aug 2004 23:59:23 GMT
Hi,

Is there a way to specify System.out/System.err as a file?  I want to sometimes be able to
redirect the error stream to the output stream within Ant (e.g. exec task).  I could use "/dev/stdout"
on Linux, but this unfortunately opens another fd instead of using the fd associated with
System.out, which can cause logging errors when I redirect the output stream of Ant to a file.
 The same goes for "/dev/stderr".  I have a workaround, but it is cumbersome.

As a demonstration of this behavior, here's a sample build.xml file.

<project name="Output test" default="execute" basedir=".">
    <target name="execute">
        <echo file="/dev/stdout" append="true">Running test...</echo>
    </target>
</project>

When you run this without redirection to a file, you will see something to the effect of:

Running test...
BUILD SUCCESSFUL
Total time: 0 seconds

If you run this with redirection to a file, you might see something to the effect of:


BUILD SUCCESSFUL
Total time: 0 seconds

Notice the missing echo text.

Thanks for any help,

Eddy


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


Mime
View raw message