[phobos] std.process deprecations

Andrei Alexandrescu via phobos phobos at puremagic.com
Thu Aug 7 11:20:25 PDT 2014


On 8/7/14, 11:03 AM, Lars Tandle Kyllingstad via phobos wrote:
> Program that behaves in the same manner, after exec* deprecation on
> Windows:
>
>      auto cmd = [ "prog", "arg1", "arg2" ];
>      version (Posix) execv(cmd[0], cmd[1 .. $]);
>      else { spawnProcess(cmd); _exit(0); }
>
> Somewhat improved program that appears to behave in almost the same
> manner on all platforms (assuming there are no other threads running!):
>
>      auto cmd = [ "prog", "arg1", "arg2" ];
>      version (Posix) execv(cmd[0], cmd[1 .. $]);
>      else _exit(wait(spawnProcess(cmd)));

Well I guess that's acceptable. Thanks. -- Andrei


More information about the phobos mailing list