tags:

views:

15

answers:

1

I'm starting to develop an extension which must interact with an external application. I can run the external application as described here, but I do not see a way to get any feedback. The only information I get is the exit status, while I need to read the application output, as it would appear on a terminal (stdout). Is there a way to do this?

A: 

After running the nsiProcess, loop while checking the isRunning attribute. When it stops running, check the exitValue attribute. As I understand it, this may behave differently on different platforms, but I did use it successfully on Windows.

pc1oad1etter
There is no need to loop, I can get an observer notified when the process is finished. But in this I don't find the output, do I? The exit value should be 0 if the process finished correctly and a numeric code different from 0 if there where problems in the execution.
Andrea
I don't know about how to get an observer notification, but I do it by having setInterval check the isRunning, and then read exitValue. Are you saying you are checking the exitValue and it is not being set?
pc1oad1etter
Sorry, I only read this reply now. I am just saying that the exitValue is not the output. Thank you anyway. To notify an observer, check the method runAsync here: https://developer.mozilla.org/en/nsIProcess
Andrea