www.delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/1995/06/05/20:30:46

From: morphine AT server DOT cs DOT jhu DOT edu (Michael Phelps)
Sender: morphine AT server DOT cs DOT jhu DOT edu
Date: Mon, 5 Jun 1995 20:04:30 -0400
To: djgpp AT sun DOT soe DOT clarkson DOT edu
Subject: Spawnl() and system()

	I've recently been having more troubles with system() and spawnl().
I've been using code such as:
	char	command_line[100];

	sprintf(command_line, "%s %s", command, arg1);
	system(command_line);

But I have been getting errors such as "EMM386 Exception #12.  Press ENTER to
reboot."  So I switched to spawnl(), with 
	spawnl(P_WAIT, command, command, arg1, NULL);
This sometimes works, and sometimes doesn't.  When it fails, it either appears
to do nothing (just as if the command didn't exist, even though it is in the
PATH), or the drive light is on for several seconds and then control is 
restored to the calling program, with nothing executed.  Eli pointed out to me
my failure to duplicate the command name a few weeks ago, but I am still 
having this problem.  Is there something I'm doing wrong here?
						---Michael Phelps, MD

- Raw text -


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