[phobos] popen/pclose and bug 3157

Lars Tandle Kyllingstad lars at kyllingen.net
Wed Sep 8 02:48:50 PDT 2010


On Wed, 2010-09-08 at 02:14 -0700, Brad Roberts wrote:
> I just updated the patch that Lars created to address a major problem with popen
> support in std.stdio.  His version handles the first problem, the requirement
> that a popened fd be closed via pclose rather than fclose.
> 
> His patch doesn't address my second issue with popen/pclose, which is getting
> the exit code from pclose back to the caller.  I don't like what I just did.  In
> fact, I hesitated quite a bit before sending out this email.  It's, well, fugly,
> but works until a better solution can be found.
> 
> I know that a major rework of std.process is a work in progress.  What's the
> state of it?  I have a need, right now, for being able to execute a command and
> getting back both it's output and its exit code.. and it needs to work on all
> platforms.

The current status is that the POSIX version works, and has done so for
a while.  Its incorporation in Phobos, and development of the Windows
implementation, has been blocked by a DMD bug which is now fixed in SVN.

So I guess the next steps will be
  1. Wait for next DMD release, which will contain aforementioned fix.
  2. Finish up Windows version.
  3. Code review and hopefully acceptance in time for following release.
[ 4. Deprecation and subsequent death of File.popen(). ;) ]

-Lars



More information about the phobos mailing list