digitalmars.D - Re: Windows command line and execv
- Kagamin <spam here.lot> Aug 20 2010
- Kagamin <spam here.lot> Aug 20 2010
- Andrei Alexandrescu <SeeWebsiteForEmail erdani.org> Aug 20 2010
- Kagamin <spam here.lot> Aug 20 2010
- Kagamin <spam here.lot> Aug 20 2010
- "Nick Sabalausky" <a a.a> Aug 20 2010
- "Nick Sabalausky" <a a.a> Aug 20 2010
Nick Sabalausky Wrote:Is execv known to trick the windows command-line into giving control back to the user?
on Linux though (assuming you add the proper "./", of course).
Looks like execv doesn't wait for application exit.
Aug 20 2010
Kagamin Wrote:Is execv known to trick the windows command-line into giving control back to the user?
on Linux though (assuming you add the proper "./", of course).
Looks like execv doesn't wait for application exit.
Try to sleep after execv.
Aug 20 2010
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?
on Linux though (assuming you add the proper "./", of course).
Looks like execv doesn't wait for application exit.
Try to sleep after execv.
I think a form of join/wait is more appropriate. Andrei
Aug 20 2010
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 parent process and when parent exits, cmd prints command prompt, but child is still running.
Aug 20 2010
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.
Aug 20 2010
"Kagamin" <spam here.lot> wrote in message news:i4mif8$2p1r$1 digitalmars.com...Kagamin Wrote:Is execv known to trick the windows command-line into giving control back to the user?
fine on Linux though (assuming you add the proper "./", of course).
Looks like execv doesn't wait for application exit.
Try to sleep after execv.
execv always replaces the current process with the new one, so it never returns.
Aug 20 2010
"Nick Sabalausky" <a a.a> wrote in message news:i4mmg2$a1i$1 digitalmars.com..."Kagamin" <spam here.lot> wrote in message news:i4mif8$2p1r$1 digitalmars.com...Kagamin Wrote:Is execv known to trick the windows command-line into giving control back to the user?
works fine on Linux though (assuming you add the proper "./", of course).
Looks like execv doesn't wait for application exit.
Try to sleep after execv.
execv always replaces the current process with the new one, so it never returns.
(Contrary to phobos docs: http://d.puremagic.com/issues/show_bug.cgi?id=3158 )
Aug 20 2010