ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Vihan Pandey" <>
Subject Re: Suppressing error messages from chmod and chgrp tasks
Date Wed, 22 Aug 2007 18:10:55 GMT
> > Don't these tasks extend <exec>?  Can you simply
> > redirect their error output to /dev/null?
> Even if I could, I do not know if I would want to do that since I would
> loose other useful information.

You could try this in exec(but its totally *nix specific)

your_command withparams_and_switches 2>> my_error.txt | tee >> my_output.txt

e.g say you have a file called on your present working
directory, and your task is to read its contents, you could do :

cat 2>> my_error.txt | tee >> my_output.txt

If there is any error it is appended to my_error.txt and any proper
output is appended to my_output.txt.

All you have to do after that is have a mechanism to keep rotating
my_error.txt and my_output.txt periodically as an when they are run so
that you can have your ``useful information". You could use a simple
<copy> task to do that.

I'm sorry if this is too much *nix and hardly any Ant, but the idea
just occured to me :-)


- vihan

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message