[phobos] popen/pclose and bug 3157

Brad Roberts braddr at puremagic.com
Thu Sep 9 01:22:47 PDT 2010


On 9/9/2010 12:59 AM, Lars Tandle Kyllingstad wrote:
> On Wed, 2010-09-08 at 13:52 -0700, Brad Roberts wrote:
>> On Wed, 8 Sep 2010, Lars Tandle Kyllingstad wrote:
>>> On Wed, 2010-09-08 at 02:14 -0700, Brad Roberts wrote:
>>>> 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
>>
>> Would you point me to the docs for the new version?
> 
> 
> Sure:
> 
>   http://kyllingen.net/code/ltk/doc/process.html
> 
> -Lars
> 

Thanks.. I like the looks of it.  spawnProcess looks like exactly what I'd love
to have right now. :)

I didn't read super closely, but some things that I noticed:

In enum Redirect, you might want to change 'all' to 'allstd' or something. Also,
you might want to generally comment about what's done with fd's NOT in the 0..2
(inclusive) range.

You have such a rich set for spawnProcess that the omission of a form of
pipeProcess, pipeShell, execute, and shell that also takes an env array stands out.

Thanks for building this,
Brad


More information about the phobos mailing list