Windows command line and execv

Steven Schveighoffer schveiguy at yahoo.com
Mon Aug 23 05:14:57 PDT 2010


On Fri, 20 Aug 2010 02:48:51 -0400, Nick Sabalausky <a at a.a> wrote:

> "Nick Sabalausky" <a at a.a> wrote in message
> news:i4kv18$14qh$1 at digitalmars.com...
>> Is execv known to
>> trick the windows command-line into giving control back to the user?
>>
>
> Ok that seems to be the case. See the attached screenshot. But it works  
> fine
> on Linux though (assuming you add the proper "./", of course).

std.process.system simply calls the standard C system function.  So  
whatever Windows does with that is the same as when you call the D version.

>
> Something else interesting to note for anyone who didn't already know  
> (like
> me), is that if you change the body of execA's main to:
>
> write("In A"); // Note this doesn't automatically flush
> system("execB");
>
> Then the output is backwards (on either Windows or Linux):
>
> In B
> In A

phobos I/O is built on top of the C I/O model, which auto-flushes after  
newlines (I think only on consoles, but I'm not sure).

-Steve


More information about the Digitalmars-d mailing list