New std.process revival

Alex Rønne Petersen alex at lycus.org
Fri Dec 7 22:27:50 PST 2012


On 07-12-2012 14:20, Jakob Bornecrantz wrote:
> On Thursday, 6 December 2012 at 18:40:57 UTC, Alex Rønne Petersen wrote:
>> Hi,
>>
>> I decided to take a stab at reviving the new std.process written by
>> Lars T. Kyllingstad and Steven Schveighoffer.
>>
>> The result is here:
>> https://github.com/alexrp/phobos/tree/new-std-process-update
>
> https://github.com/alexrp/phobos/blob/new-std-process-update/std/process.d#L417
>
>
> You need to call toArgz and toStringz before the fork, since either of
> those can be in TLS. Test with:
>
>
> string cmd = "echo";
> string[] args1 = ["hello"];
> string[] args2 = [];
>
> void main()
> {
>    spawnProcess(cmd, args2);
>    spawnProcess(cmd, args1);
>    args ~= "World";
>    spawnProcess(cmd, args2);
> }
>
>
> I'm not exactly sure what is up, but in one of my projects I had this
> problem. I solved it by just making all the string[]s into __gshared.
>
> Cheers, Jakob.

Thanks, fixed.

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


More information about the Digitalmars-d mailing list