On 8/23/10 5:14 CDT, Steven Schveighoffer wrote:
On Fri, 20 Aug 2010 02:48:51 -0400, Nick Sabalausky <a...@a.a> wrote:

"Nick Sabalausky" <a...@a.a> wrote in message
news:i4kv18$14q...@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).

Yes, to the best of my knowledge auto-flushing upon \n happens only if isatty() is true.

Andrei

Reply via email to