Thread overview | |||||
---|---|---|---|---|---|
|
June 17, 2013 make Pid constructor public | ||||
---|---|---|---|---|
| ||||
Attachments:
| inside std.process it says: // Pids are only meant to be constructed inside this module, so we make the constructor private. However, this makes a number of useful functions from std.process useless unless the processes were created via one of std.process' functions. Can we make std.process.Pid.this(int pid) public? Use case: int pid=...; //parse pid from call to 'ps au' for example std.process.kill(pid); std.process.wait(pid); //etc |
June 18, 2013 Re: make Pid constructor public | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Mon, 17 Jun 2013 18:38:34 -0400, Timothee Cour <thelastmammoth@gmail.com> wrote:
> inside std.process it says:
> // Pids are only meant to be constructed inside this module, so we make the
> constructor private.
> However, this makes a number of useful functions from std.process useless
> unless the processes were created via one of std.process' functions.
> Can we make std.process.Pid.this(int pid) public?
Not a bad idea. In fact, I think we were toying with possibly having ways to obtain Pids from the OS. This would be an interim step.
-Steve
|
April 18, 2017 Re: make Pid constructor public | ||||
---|---|---|---|---|
| ||||
Posted in reply to Timothee Cour | On Monday, 17 June 2013 at 22:38:47 UTC, Timothee Cour wrote:
> inside std.process it says:
> // Pids are only meant to be constructed inside this module, so we make the
> constructor private.
> However, this makes a number of useful functions from std.process useless
> unless the processes were created via one of std.process' functions.
> Can we make std.process.Pid.this(int pid) public?
>
> Use case:
> int pid=...; //parse pid from call to 'ps au' for example
> std.process.kill(pid);
> std.process.wait(pid);
> //etc
I know this is an old post, but I need this feature! Any plan to make this happen?
|
Copyright © 1999-2021 by the D Language Foundation