Checking if the subprocess is failing
Hi,
We are using AbiWord.exe to convert the .doc files to .html format. I am doing it using the java code in my application. The code looks like this
String command = "C:\Program Files\AbiSuite2
AbiWord\bin\AbiWord.exe" + "--to=html" + "resume.doc"
Process process = Runtime.getRuntime().exec(command);
process.waitFor();
int retval = process.exitValue();
System.out.println("exit value is " + retval);
if (retval != 0) {
engine.setField ("var.error", "Unable to convert word documents. Return value was: " + retval);
return null;
}
It works fine for many resumes. But for some resumes the AbiWord just crashes and gives the following error dialog box.
An unhandled win32 exception occured in AbiWord.exe[3928]
Now the problem is because my code in application waits for the conversion process to complete and the conversion process crashes.
What i want to do is in case of failure from AbiWord i want to just delete the original .doc resume file which causes a crash. Anybody has any thoughts how it can be done.
Thanks in advance.
-Prads.

