in reply to how to terminate a program?

If you are using system() to start another program, you pretty much have to wait until it's done to do anything else. You could fool around with alarm() to give that part of the code a maximum time that it can process, but you haven't said enough for anyone to suggest a real solution. Post code. :)

You probably want to fork off (or whatever your operating system does) another process so your main program can continue (and have a chance to interact with other processes).

--
brian d foy <brian@stonehenge.com>