El 24/06/2005, a las 5:01, Reshat Sabiq escribió:

Is there any nspr function or XPCOM service to search the executable in the $PATH by name?

You can use execvp (spawnvp on Windows) instead.
For that you could use system(...). However, to be able to kill it after a timeout, you probably need to use the calls above (the alternative is to call system from a separate thread), register a signal handler to detect the process exiting or use wait, and apparently also have a thread that wakes up after the time-out, checks if the process exited, and kills it if it hasn't.

But that is not portable :-m
Mozilla have not any service for this?

Anyway, thank you for the Ideas. Other solution is simply enter in a loop and check if the process lives 100ms, and after the timeout, kill it.

--
Greets
Keymon


_______________________________________________
Mozilla-xpcom mailing list
[email protected]
http://mail.mozilla.org/listinfo/mozilla-xpcom

Reply via email to