Héctor Rivas Gándara wrote:
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?
It is portable if you use #if defined(WIN32) spawnvp #else fork and execvp // should work on all Unices (and probably also on MAC)I haven't looked into doing the same thing using PR_... It might be possible.
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.
Yes, less effcient and graceful, but something like that would also work.
-- Greets Keymon
smime.p7s
Description: S/MIME Cryptographic Signature
