Hi all,
I am working on Windows 2K platform with jdk 1.3.1 and ant 1.5. I would
like to
use the timeout option of the exec command.
I set the timeout to 1000 (one second). But the task continues after
timeout has been reached until it finishes.
xml file is:
<project name="xxxxx" default="all" basedir=".">
<target name="Batch">
<exec dir ="c:/temp" executable="c:/home/cmd/save.bat" os="Windows
2000"
output="Batch.lst" append="false" timeout="1000">
<env key="BATCH" value="BT1AAA"/>
<env key="APPPATH" value="C:/Tomcat-4.0.4/webapps/exploitation"/>
</exec>
</target>
</project>
I am using this main program to start the task: (run method of a thread)
public void run() {
String dir = "c:/temp";
String buildxml = dir + File.separator + "run.xml";
String[] args
= new String[] {"-buildfile", buildxml, "Batch"};
Main.start(args, null, null);
}
The output I am getting is the following:
C:\Documents and Settings\srousse\jbproject\essaiEnvp\classes>set
CLASSPATH=C:\Documents and
Settings\srousse\jbproject\essaiEnvp\classes;c:\jdk131\jre\lib\rt.jar;c:
\classes\framework\ant.jar;c:\classes\framework\antlr.jar;c:\classes\fra
mework\sax.jar;c:\classes\framework\jaxpapi.jar
C:\Documents and Settings\srousse\jbproject\essaiEnvp\classes>java
essaienvp.Essai
Buildfile: c:\temp\run.xml
Batch:
[exec] Timeout: killed the sub-process
[exec] Result: 1
BUILD SUCCESSFUL
Total time: 18 seconds
What could be the cause of that problem ?
In advance thanks.
Sylvain.
--
To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>