Why are the exec* functions deprecated in std.process?

Andrei Alexandrescu SeeWebsiteForEmail at erdani.org
Tue Oct 29 13:56:18 PDT 2013


On 10/29/13 1:25 PM, Lars T. Kyllingstad wrote:
> I'm not suggesting this as a solution for you, but let me just point out
> that you wouldn't have to wait until it's done.  You'd spawn it and
> exit.  On Windows this is, as Vladimir points out, exactly what happens
> when you call exec*().  On POSIX it comes at the cost of a fork() (which
> I completely agree is unacceptable in some situations).

Replacing

   return wait(spawnShell(cmd)) != 0;

with

   spawnShell(cmd);
   return 0;

as the last line of main() produces weird errors, including intermittent 
segfaults. Thoughts?


Andrei



More information about the Digitalmars-d mailing list