From: david <[EMAIL PROTECTED]> > Jenda Krynicky wrote: > > > From: david <[EMAIL PROTECTED]> > >> Chris wrote: > >> > >> > # ** ** > >> > # print "Trying to Run -- system $playerApp ($webCast):\n"; > >> > # system $playerApp, ($webCast); > >> > # ** ** > >> > > >> > # ** ** > >> > print "Trying to Run -- exec $playerApp $webCast:\n"; > >> > exec $playerApp, ($webCast); > >> > # ** ** > >> > > >> > >> system() is basically just a fork(), exec(), wait() > > > > But only under some operating systems! > > can you give you an example where system() is implemented different > than a fork(), exec(), wait()? > > i don't have any experience other than the [U|Li]nux world so i don't > know how the Windos, Mac, etc works.
Windows is one example. There you do not create a new process by forking and then changin the program your process executes, but by a CreateProcess(): (from MSDN) The CreateProcess function creates a new process and its primary thread. The new process runs the specified executable file in the security context of the calling process. BOOL CreateProcess( LPCTSTR lpApplicationName, LPTSTR lpCommandLine, LPSECURITY_ATTRIBUTES lpProcessAttributes, LPSECURITY_ATTRIBUTES lpThreadAttributes, BOOL bInheritHandles, DWORD dwCreationFlags, LPVOID lpEnvironment, LPCTSTR lpCurrentDirectory, LPSTARTUPINFO lpStartupInfo, LPPROCESS_INFORMATION lpProcessInformation ); fork() is totally alien to Windows. Therefore perl under Windows implements system() with CreateProcess(), fork() is emulated by creating thread and exec() uses CreateProcess() and exits the current thread or process. This means that it's much more efficient to use system() then fork() & exec() under Windows. Jenda P.S.: I did not look at the actual implementation of fork(), exec() and system() in Perl sources. This is just from what I know about windows and what I read in the docs and posts. But I believe I am about right. =========== [EMAIL PROTECTED] == http://Jenda.Krynicky.cz ========== There is a reason for living. There must be. I've seen it somewhere. It's just that in the mess on my table ... and in my brain I can't find it. --- me -- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]