You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by de...@canoo.com on 2001/09/12 08:24:05 UTC

howTo call an external process

HI,
I need to call an external process from within my Java program and parse the
outputstream of the process.
What sort of built-in wrappers does ant have for this kind of task ?


detlef

Re: howTo call an external process

Posted by Stefan Bodewig <bo...@apache.org>.
On Wed, 12 Sep 2001, detlef brendle <de...@canoo.com> wrote:

> I need to call an external process from within my Java program and
> parse the outputstream of the process.  What sort of built-in
> wrappers does ant have for this kind of task ?

Take a look at org.apache.tools.ant.taskdefs.Execute - this class
encapsulates the platform and VM specific logic of executing system
commands in an arbitrary directory and is used by several built-in
tasks (including <exec> and <java fork="yes">).

Stefan

RE: howTo call an external process

Posted by Ingmar Stein <st...@xtramind.com>.
Hi Detlef,

rtfm.
Use the exec task to start your external process. The record task
will catch the output. All you have to do is to write a task that
does the parsing.

Cheers,

Ingmar

> -----Original Message-----
> From: detlef.brendle@canoo.com [mailto:detlef.brendle@canoo.com]
> Sent: Mittwoch, 12. September 2001 08:24
> To: ant-dev@jakarta.apache.org
> Subject: howTo call an external process
> 
> HI,
> I need to call an external process from within my Java program and
parse
> the
> outputstream of the process.
> What sort of built-in wrappers does ant have for this kind of task ?
> 
> 
> detlef