in reply to MS Forking Blues

system and exec are doing what they ought to do. system runs an external program and returns when it exits. exec replaces the current process with another process.

Your title suggests fork but you don't actually use it in this code. On Unix, the idiom would be to fork the program and, in the child, exec the other program you want to run. When you do this, the parent continues as it is and the child immediately replaces itself with the other process.

You can get more complex if you need to do so -- and you may, on Windows, with something like the Win32 module and CreateProcess -- but I think you may have misunderstood that there are three different ideas here and just what the differences are between them.