spawnProcess: Exit parent process without terminating child process
timvol via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Fri Aug 25 12:55:09 PDT 2017
Hi guys,
I want execute a process. I know, I can execute a process using
"spawnProcess" or "executeShell". But I want exit the parent.
My code for testing purposes is the following:
int main(string[] asArgs_p)
{
if ( (asArgs_p.length >= 2) && asArgs_p[1].isDir() )
{
while(1) {}
}
else
{
import std.process;
spawnProcess([asArgs_p[0], "test"]);
}
return 0;
}
So, starting the application without any parameter, it calls
"spawnProcess" with an parameter. Now, I want that the parent
process (the process started without parameter) terminates, while
the created process remains running.
At the moment, the parent process creates the child and remains
open (because of the while(1)-loop).
Any ideas how I can exit the parent and keep the child process
running?
More information about the Digitalmars-d-learn
mailing list