S
slightlykirix
Hi,
I have a class that is supposed to call an executable fortran file that
create some additional fortran files, and then compile them. I am
performing the call to the fortran executable and the compilation steps
through the use of the ProcessBuilder.
My question is, suppose any one of the steps fail, how can java be made
aware that something has gone wrong?
For eg, when i call the fortran executable, if the fortran executable
encounters a problem, it may not produce the additional fortran files.
So, java should be notified that the next steps - calling the compiler
should not be done.
My understanding of the ProcessBuilder was that it just creates an
environment for an executable and doesn't really track what the
executable does - whether it does what it is supposed to do, or fails.
I was thinking of tracking the output of the executable with the
redirectErrorStream() and then checking to see if the stream ends with
what one would expect with an error-free run.
Is that the most elegant approach or is there something else that I am
totally missing?
TIA
--Jo
I have a class that is supposed to call an executable fortran file that
create some additional fortran files, and then compile them. I am
performing the call to the fortran executable and the compilation steps
through the use of the ProcessBuilder.
My question is, suppose any one of the steps fail, how can java be made
aware that something has gone wrong?
For eg, when i call the fortran executable, if the fortran executable
encounters a problem, it may not produce the additional fortran files.
So, java should be notified that the next steps - calling the compiler
should not be done.
My understanding of the ProcessBuilder was that it just creates an
environment for an executable and doesn't really track what the
executable does - whether it does what it is supposed to do, or fails.
I was thinking of tracking the output of the executable with the
redirectErrorStream() and then checking to see if the stream ends with
what one would expect with an error-free run.
Is that the most elegant approach or is there something else that I am
totally missing?
TIA
--Jo