You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by DATACOM - Diego <di...@datacom.ind.br> on 2007/08/20 17:10:51 UTC

Suppressing error messages from chmod and chgrp tasks

Hi all,

I am using Ant 1.7.0, JDK 5.0_04, Gentoo Linux.

It would be very useful for me if it was possible to suppress 
error/diagnostic messages from chmod, chgrp and chown tasks. In the end 
of my build I change the permissions of a number of temporary and output 
files. For many of them the changes are not possible so the log gets 
filled with a lot of error messages from chmod and chgrp.

All these three UNIX commands support the -f ("force option") that do 
exactly that. I wonder what you think about adding support to this 
option in the Ant tasks (adding a "force" parameter?!). Currently, there 
is only a "verbose" parameter.

If you know any workaround other than disabling the recording to the log 
file, please let me know.

Thanks in advance,

-- 
DIEGO Moreira da Rosa

DATACOM
Av França, 735 - Porto Alegre, RS - 90230-220
DDR: +55 51 3358 0141
Fax: +55 51 3358 0101
site: www.datacom.ind.br

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


Re: Suppressing error messages from chmod and chgrp tasks

Posted by Vihan Pandey <vi...@gmail.com>.
> > 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 foo.bar on your present working
directory, and your task is to read its contents, you could do :

cat foo.bar 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 :-)

Regards,

- vihan

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


Re: Suppressing error messages from chmod and chgrp tasks

Posted by DATACOM - Diego <di...@datacom.ind.br>.
> 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.

>> Don't use these commands, and use <apply> where you
>> have full control
>> on the command line to use -f. --DD

Yes, <apply> seems an interesting workaround. I think having a "force" 
parameter in the <chmod>, <chgrp> and <chown> tasks would still be nice, 
though.

Thanks for the tip,

-- 
DIEGO Moreira da Rosa

DATACOM
Av França, 735 - Porto Alegre, RS - 90230-220
DDR: +55 51 3358 0141
Fax: +55 51 3358 0101
site: www.datacom.ind.br

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


Re: Suppressing error messages from chmod and chgrp tasks

Posted by Matt Benson <gu...@yahoo.com>.
Don't these tasks extend <exec>?  Can you simply
redirect their error output to /dev/null?

-Matt

--- Dominique Devienne <dd...@gmail.com> wrote:

> On 8/20/07, DATACOM - Diego <di...@datacom.ind.br>
> wrote:
> > It would be very useful for me if it was possible
> to suppress
> > error/diagnostic messages from chmod, chgrp and
> chown tasks. [...]
> >
> > All these three UNIX commands support the -f
> ("force option") [...]
> >
> > If you know any workaround other than disabling
> the recording to the log
> > file, please let me know.
> 
> Don't use these commands, and use <apply> where you
> have full control
> on the command line to use -f. --DD
> 
>
---------------------------------------------------------------------
> To unsubscribe, e-mail:
> user-unsubscribe@ant.apache.org
> For additional commands, e-mail:
> user-help@ant.apache.org
> 
> 



      ____________________________________________________________________________________
Fussy? Opinionated? Impossible to please? Perfect.  Join Yahoo!'s user panel and lay it on us. http://surveylink.yahoo.com/gmrs/yahoo_panel_invite.asp?a=7 


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


Re: Suppressing error messages from chmod and chgrp tasks

Posted by Dominique Devienne <dd...@gmail.com>.
On 8/20/07, DATACOM - Diego <di...@datacom.ind.br> wrote:
> It would be very useful for me if it was possible to suppress
> error/diagnostic messages from chmod, chgrp and chown tasks. [...]
>
> All these three UNIX commands support the -f ("force option") [...]
>
> If you know any workaround other than disabling the recording to the log
> file, please let me know.

Don't use these commands, and use <apply> where you have full control
on the command line to use -f. --DD

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