So -- how does system(1,"foo") work on Windows?
It just calls CreateProcess with the CREATE_NEW_PROCESS_GROUP flag bit set. See Win32::Process for the details.
It's a bit more complicated as it has to arrange for wait and waitpid to work.
Examine what is said, not who speaks -- Silence betokens consent -- Love the truth but pardon error.
Lingua non convalesco, consenesco et abolesco. -- Rule 1 has a caveat! -- Who broke the cabal?
"Science is about questioning the status quo. Questioning authority".
In the absence of evidence, opinion is indistinguishable from prejudice.
| [reply] |
Do you know why CREATE_NEW_PROCESS_GROUP flag is used ? It is a problem because child processes no longer respond to Ctrl+C, while the main script does. Then the main script exits on keyboard interrupt, but child processes linger in the background where no onne can see them.
| [reply] [d/l] |
But Perl is the only language I've come across that has anything like system(1,"blah") that returns control to the calling Perl script on Windows.
The system call CreateProcess can achieve this. CreateProcess can be called from C, C++, Perl and surely many other languages.
| [reply] [d/l] [select] |
Fascinating:
Support for concurrent interpreters and the fork() emulation was implemented by ActiveState, with funding from Microsoft Corporation.
-sam
| [reply] |
I think the more specific link should be perlport (and then scroll down to "system"). This notes that system(1, @args) does the magic thing, and also that it's Win32 specific (which is a bit of a shame).
--
.sig : File not found.
| [reply] |
Didn't you answer this already? magic!
| [reply] |