Jeff, on Nov 9 2008, 01:50 AM, said:
You are probably having such a difficult time because ultimately the answer is "it depends".
If each application in the stream returns it's return code back to the parent application and the parent application in turn returns the return code of the child as its own, then the answer is "yes".
Unfortunately this is extremely unlikely and you are most likely stuck with the return code of the original application that is spawned as this application is going to have activities that it performs after the child application has completed (e.g. logically the child application was spawned in order to return some data to the parent or complete some sub-process on the parent's behalf) and as a result the return code of the parent application will be reflective of the results of the cumulative activities of the parent where the success of the child sub-process may or may not be relevant, but most certainly will be interpreted and/or handled.
If you are launching applications that effect a pipeline (e.g. Windows cmd.exe or powershell.exe) then you have a much better chance that the return codes will be passed back up the pipe.
Ultimately, I would recommend that you design your processing based on the answer to this question being "no" as that would be more practical.
If each application in the stream returns it's return code back to the parent application and the parent application in turn returns the return code of the child as its own, then the answer is "yes".
Unfortunately this is extremely unlikely and you are most likely stuck with the return code of the original application that is spawned as this application is going to have activities that it performs after the child application has completed (e.g. logically the child application was spawned in order to return some data to the parent or complete some sub-process on the parent's behalf) and as a result the return code of the parent application will be reflective of the results of the cumulative activities of the parent where the success of the child sub-process may or may not be relevant, but most certainly will be interpreted and/or handled.
If you are launching applications that effect a pipeline (e.g. Windows cmd.exe or powershell.exe) then you have a much better chance that the return codes will be passed back up the pipe.
Ultimately, I would recommend that you design your processing based on the answer to this question being "no" as that would be more practical.
In other words, no.





Sign In
Register
Help