ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Bill Burton" <>
Subject Re: [PATCH] Asynchronous execution of processes
Date Thu, 08 Nov 2001 00:53:19 GMT
Hello Jose,

Jose Alberto Fernandez wrote:
> From: "Bill Burton" <>
> > Hello Jose,
> >
> > Thanks for working on this often requested functionality.
> >
> > Shouldn't output="file" be required when detach="true"?
> >
> > In the case of the <java> task, how will the behavior differ if
> > fork="true" or not?  I would think if fork="true" then the standard
> > streams should be redirected to whatever output file was specified.
> >
> Actually, is the other way around, for the time being you should not use any of the output
> Due to the way IO is manage by the current code. Notice also that all the outut redirection
is done
> by Java so once the the ANT's VM ends IO has no where to go.
> What do the external process do when that happens it is upto the OS.

When I wrote some similar functionality a while ago for <exec>, I made it
so that when detach="true", any value of the output attribute was passed
as an environment variable.  In addition this forced execution through the
antRun script.  In the antRun script, if the output environment variable
was set, it used shell redirection when running the program to write the
output to the specified file.  That way, the detached program was
completely autonomous and had no dependencies on Ant's JVM.

If you're interested, I could dig up the code that does this.

> The current implementation for <java> is shuch that detach=true ==> fork=true.
> But still you cannot use "output" in detach mode because the file will be closed
> before the process is allowed to finish.

I see.


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

View raw message