You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "Doremieux, Olivier" <Ol...@fc.celera.com> on 2000/08/08 01:29:30 UTC

Excec question

Hello,

I am trying to run the exec example :
<exec dir="${src}" command="dir" os="windows" output="dir.txt" />

Where is supposed to be the output?
Is the example really working

Thank you

Olivier Doremieux

Re: Excec question

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JG" == Jesse Glick <Je...@netbeans.com> writes:

 JG> Isn't this still the case for Exec.output attribute?

Yes and no. You are looking at Exec, while <exec> now invokes ExecTask
(where the argument to setOutput is a File).

ExecTask is a (build file compatible) replacement for Exec. Exec is
still there for people who have built there own tasks that inherit
from Exec and will go away after the next release (it is deprecated in
the current CVS version).

Stefan

Re: Excec question

Posted by Jesse Glick <Je...@netbeans.com>.
Stefan Bodewig wrote:
> 
> >>>>> "DO" == Doremieux, Olivier <Ol...@fc.celera.com> writes:
> 
>  DO> <exec dir="${src}" command="dir" os="windows" output="dir.txt" />
> 
>  DO> Where is supposed to be the output?
> 
> ${basedir}/dir.txt. Relative filenames should always be considered
> relative to the project's basedir.
> 
> There have been some places in Ant 1.1 where this was not the case
> (they were taken relative to the directory you had invoked Ant from).

Isn't this still the case for Exec.output attribute? I use 1.1 and know
it is broken there, but it does not look like the current version fixes
it.

    public void setOutput(String out) {
        this.out = out;
    }
......
            if( out!=null )  {
                fos=new PrintWriter( new FileWriter( out ) );
                log("Output redirected to " + out, Project.MSG_VERBOSE);
            }

Presumably 'out' should be a File.

-Jesse

-- 
Jesse Glick   <ma...@netbeans.com>
NetBeans, Open APIs  <http://www.netbeans.org/>
tel (+4202) 3300-9161 Sun Micro x49161 Praha CR

Re: Excec question

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "DO" == Doremieux, Olivier <Ol...@fc.celera.com> writes:

 DO> <exec dir="${src}" command="dir" os="windows" output="dir.txt" />

 DO> Where is supposed to be the output?  

${basedir}/dir.txt. Relative filenames should always be considered
relative to the project's basedir. 

There have been some places in Ant 1.1 where this was not the case
(they were taken relative to the directory you had invoked Ant from).

 DO> Is the example really working

It depends on the version of Ant I guess 8^). Is it working for you?
If not, what happens?

Stefan