Re: Windows command line and execv

2010-08-23 Thread Andrei Alexandrescu
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

Windows command line and execv

2010-08-20 Thread Nick Sabalausky
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 ./,

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Nick Sabalausky Wrote: Is execv known to trick the windows command-line into giving control back to the user? Trick what into what? 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). Something else

Re: Windows command line and execv

2010-08-20 Thread Nick Sabalausky
Kagamin s...@here.lot wrote in message news:i4mfpe$2cj...@digitalmars.com... Nick Sabalausky Wrote: Is execv known to trick the windows command-line into giving control back to the user? Trick what into what? See the screenshot I attached to that post. That should clarify what I mean.

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Nick Sabalausky Wrote: Anyway, console output is broken in phobos. In what way? http://d.puremagic.com/issues/show_bug.cgi?id=2742

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Nick Sabalausky Wrote: 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). Looks like execv doesn't wait for

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Kagamin Wrote: 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). Looks like execv doesn't wait for

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Nick Sabalausky Wrote: 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). Also I'm not sure you can implement

Re: Windows command line and execv

2010-08-20 Thread Andrei Alexandrescu
On 08/20/2010 01:44 PM, Kagamin wrote: Kagamin Wrote: 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). Looks like

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Andrei Alexandrescu Wrote: Try to sleep after execv. I think a form of join/wait is more appropriate. That should be done inside execv. If one wants to join in user code, execv should return a waitable handle. Hmm msdn says it works in posix way. The problem seems to be cmd waits on

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Kagamin Wrote: Hmm msdn says it works in posix way. The problem seems to be cmd waits on parent process and when parent exits, cmd prints command prompt, but child is still running. No, it doesn't say it works in posix way, it only says execv doesn't return.

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Kagamin Wrote: Nick Sabalausky Wrote: 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

Re: Windows command line and execv

2010-08-20 Thread Kagamin
Nick Sabalausky Wrote: 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):

Re: Windows command line and execv

2010-08-20 Thread Nick Sabalausky
Kagamin s...@here.lot wrote in message news:i4mksr$2f...@digitalmars.com... Nick Sabalausky Wrote: 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

Re: Windows command line and execv

2010-08-20 Thread Nick Sabalausky
Nick Sabalausky a...@a.a wrote in message news:i4mmg2$a1...@digitalmars.com... Kagamin s...@here.lot wrote in message news:i4mif8$2p1...@digitalmars.com... Kagamin Wrote: Is execv known to trick the windows command-line into giving control back to the user? Ok that seems to be the

Re: Windows command line and execv

2010-08-20 Thread Nick Sabalausky
Kagamin s...@here.lot wrote in message news:i4mif8$2p1...@digitalmars.com... Kagamin Wrote: 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