[RFC] Modules for processes manipulation

Alex Rønne Petersen alex at lycus.org
Mon Nov 26 05:13:32 PST 2012


On 26-11-2012 08:02, Denis Shelomovskij wrote:
> I'd like to see in D something like .Net's `System.Diagnostics.Process`
> and friends. Reasons:
> * probably, lots of D users was previously on C#
> * .Net's API looks really good and user friendly
>
> Consider these processes manipulation modules:
> http://denis-sh.github.com/hooking/hooking.windows.process.html
> and hooking.windows.{thread|processmemory|processstartinfo}
> Differences from .Net's:
> * RAII (i.e. no handle leaking)
> * do not cache process properties (see Appendix)
> * able to launch with argument strings array, not only command line
> * able to work with process memory
>      Tip: a good way to to access current process memory without
> `Exception`s thrown on failure instead of `Error`s.
>
> Currently it misses some features and is Windows-only.
> So the questions are:
> * Should I add missed features for Windows realisation (i.e. is it needed)?
> * Should I create a cross-platform realisation (i.e. is it needed)?
> * Will it be possibly accepted in Phobos?
>
>
> Appendix about .Net's `Process`:
> All properties are cached. And it is documented only in MSDN article
> about `Refresh` member function. So one has to remember this fact and be
> careful with this tricky .Net. E.g. one shouldn't believe words like
> "representing the operating system threads currently running in the
> associated process" from `Threads` property docs and remember it's cached.
>

See: https://github.com/kyllingstad/phobos/tree/new-std-process

-- 
Alex Rønne Petersen
alex at lycus.org
http://lycus.org


More information about the Digitalmars-d mailing list