Re: std.process: spawnProcess

2018-09-08 Thread viniarck via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned

Re: std.process: spawnProcess

2018-09-08 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2018-09-08 at 10:24 +, FreeSlave via Digitalmars-d-learn wrote: > On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: > > From what I can see, processes created with std.process: > > spawnProcess are not terminated when the creating process > > term

Re: std.process: spawnProcess

2018-09-08 Thread FreeSlave via Digitalmars-d-learn
On Friday, 7 September 2018 at 16:44:09 UTC, Russel Winder wrote: I guess this might work on Windows, but I am on Linux and OSX, so I'll have to try another route. On Posix systems you may try using SIGCHLD handler. Google for exact examples.

Re: std.process: spawnProcess

2018-09-08 Thread FreeSlave via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. No, detached is not default. By

Re: std.process: spawnProcess

2018-09-08 Thread Russel Winder via Digitalmars-d-learn
On Sat, 2018-09-08 at 02:38 +, Basile B. via Digitalmars-d-learn wrote: > […] > You can wrap in a Process struct or class and take advantage of > the destructor to do that. Assuming you write standard GC-ed code > the destructor should be called at the end or if you free > manually the reso

Re: std.process: spawnProcess

2018-09-07 Thread Basile B. via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned

Re: std.process: spawnProcess

2018-09-07 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2018-09-07 at 16:05 +, Dr.No via Digitalmars-d-learn wrote: > […] > You also can use WINAPI's job object. It will close the registred > process, even if the application exit abruptly. I have, by now, > only a link to a C# example how do that but I believe you can > convert to D easi

Re: std.process: spawnProcess

2018-09-07 Thread Russel Winder via Digitalmars-d-learn
On Fri, 2018-09-07 at 15:53 +, Andrea Fontana via Digitalmars-d-learn wrote: > […] > void main() > { > > ... > auto yourpid = spawnProcess(...); > scope(exit) kill(yourpid, SIGINT); // Or SIGKILL :) > // Or: scope(exit) wait(yourpid); > ... > } > Nice thought, but the spawn is deep in the h

Re: std.process: spawnProcess

2018-09-07 Thread Dr.No via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned

Re: std.process: spawnProcess

2018-09-07 Thread Andrea Fontana via Digitalmars-d-learn
On Friday, 7 September 2018 at 14:36:42 UTC, Russel Winder wrote: From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned

std.process: spawnProcess

2018-09-07 Thread Russel Winder via Digitalmars-d-learn
From what I can see, processes created with std.process: spawnProcess are not terminated when the creating process terminates, i.e. it seems Config.detached is the default for these process. Is there a way of all spawned processes being terminated on main termination? -- Russel