Re: system_exec()
- Posted by Igor Kachan <kinz at peterlink.ru> Jul 11, 2003
- 566 views
Hi Juergen, > Hi all, > > I recently noticed, that on my system (Win 98/1st ed., Eu 2.4), after > calling 'system_exec("foo.exe", i)' my interpreted Eu program doesn't > continue with the next statement, but waits, until execution of 'foo.exe' > is finished. For instance try: > if system_exec("calc", 2) then end if > puts(1, "Hi there.") > if getc(0) then end if system_exec() is function, so it waits the exit code to return it into your program from the child process. > This behaviour is very useful in certain situations. Unfortunately, I > noticed it, when I had almost finished writing my own routine with this > functionality. > At least on Win 98/1st ed., system() behaves differently. It does *not* > wait for the termination of the called program. system() is procedure, so it doesn't wait any exit code, but the plane DOS is not multitasking OS and DOS just executes the commands step by step. OS waits. > Is the behaviour of system()/system_exec() the same on all windows > platforms? How about Linux/FreeBSD? I think this should be clearly > documented. Windows, Linux, FreeBSD are all multitasking OSs, so system() doesn't stop your parent program. Just some thoughts, I am not too sure. > Best regards, > Juergen Best regards, Igor Kachan kinz at peterlink.ru