www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1996/11/13/01:41:18

Date: Wed, 13 Nov 1996 08:29:11 +0200 (IST)
From: Eli Zaretskii <eliz AT is DOT elta DOT co DOT il>
To: Paul Koshevoy <P DOT Koshevoy AT m DOT cc DOT utah DOT edu>
Cc: djgpp AT delorie DOT com
Subject: Re: system(...) , spawnl(...)
In-Reply-To: <566b2b$9cl@news.cc.utah.edu>
Message-Id: <Pine.SUN.3.91.961113082231.4470B-100000@is>
Mime-Version: 1.0

On Mon, 11 Nov 1996, Paul Koshevoy wrote:

> ins system(const char *)  and  int spawnl(int, char *, NULL)
> functions. The problem is when I spawn a child program with either of
> this functions the execution never gets back to parent . The child
> process terminates but the parent process does not resume.

So where does this leave your machine?  Do you get the DOS command 
prompt, or are you stuck and need a reboot, or what?

> Here is a part of my code :
> 
> char * ext=filename[pos]->get_part2(0);
> if( !strcmp(ext,"bat")  ||  !strcmp(ext,"BAT")  ||  !strcmp(ext,"EXE")
> || !strcmp(ext,"COM")  ||  !strcmp(ext,"exe")  ||  !strcmp(ext,"EXE"))
>     {
>         panel1->kill();
>         panel2->kill();
>         int result=system(filename[pos]->get_filename());
>         panel1->refresh();
>         panel2->refresh();
>     }

Is this a C++ program?  If it's C, then you can't say "int i = system" in 
the middle of a block.  If this is a typo, please post the exact excerpt 
from your source code (minor typos could obscure important clues to the 
cause of your problem).

You might also consider writing a trivial 10-liner which calls `system'
with any string you like (which should work), then working your way back
from that trivial program to your code above to see what's different. 

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019