Game Development Community

Execute binary in C++?

by Stefan Lundmark · in Technical Issues · 06/09/2004 (3:49 pm) · 2 replies

I totally forgot how to do this.
What I want is to simply execute a program from inside the code.

Help! :)

#1
06/09/2004 (4:05 pm)
...
#2
06/09/2004 (4:23 pm)
Keep in mind that by itself, system() is a blocking call--your primary application will halt and wait for an exit message from the called executable. There are various ways to over-ride/overcome this of course.

This doesn't matter too much in applications that are guaranteed to have a very short execution time, but if you want to call a specific application that will "run" for a long time, system() needs to probably be combined with fork(), or at least call a startup script that actually brings your application up, and then exits quickly.