The new std.process is ready for review

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Feb 23 08:42:26 PST 2013


On Sat, Feb 23, 2013 at 12:31:19PM +0100, Lars T. Kyllingstad wrote:
> It's been years in the coming, but we finally got it done. :)  The
> upshot is that the module has actually seen active use over those
> years, both by yours truly and others, so hopefully the worst
> wrinkles are already ironed out.

Finally!!! *applause*


> Pull request:
> https://github.com/D-Programming-Language/phobos/pull/1151
> 
> Code:
> https://github.com/kyllingstad/phobos/blob/std-process2/std/process2.d
> 
> Documentation:
> http://www.kyllingen.net/code/std-process2/phobos-prerelease/std_process2.html

I just looked over the docs. Looks very good!

Just a few minor comments:

- wait():
   - Some code examples would be nice.

   - For the POSIX-specific version, I thought the Posix standard
     specifies that the actual return code / signal number should be
     extracted by means of system-specific macros (in C anyway)?
     Wouldn't it be better to encapsulate this in a POD struct or
     something instead of exposing the implementation-specific values to
     the user?

   - How do I wait for *any* child process to terminate, not just a
     specific Pid?

- execute() and shell(): I'm a bit concerned about returning the
  *entire* output of a process as a string. What if the output generates
  too much output to store in a string? Would it be better to return a
  range instead (either a range of chars or range of lines maybe)? Or is
  this what pipeProcess was intended for? In any case, would it make
  sense to specify some kind of upper limit to the size of the output so
  that the program won't be vulnerable to bad subprocess behaviour
  (generate infinite output, etc.)?

- ProcessException: are there any specific methods to help user code
  extract information about the error? Or is the user expected to check
  errno himself (on Posix; or whatever it is on Windows)?


> I hope we can get it reviewed in time for the next release.  (The
> wiki page indicates that both std.benchmark and std.uni are
> currently being reviewed, but I fail to find any "official" review
> threads on the forum.  Is the wiki just out of date?)
[...]

I was *intending* to re-review std.uni, it's been sitting in my inbox
for a few weeks already, but alas, I keep getting distracted by other
things. I'll see if I can get to it today. Sighh... so many fun things
to do, so little time...


T

-- 
If I were two-faced, would I be wearing this one? -- Abraham Lincoln


More information about the Digitalmars-d mailing list