From: i_b_malone AT yahoo DOT com (imalone) Newsgroups: comp.os.msdos.djgpp Subject: Re: spawn() problem. Date: Sat, 19 May 2001 11:09:17 GMT Organization: University of Cambridge, England Lines: 26 Message-ID: <3b065312.2872240@nntp-serv.cam.ac.uk> References: <3405-Fri18May2001104125+0300-eliz AT is DOT elta DOT co DOT il> <2427-Fri18May2001125319+0300-eliz AT is DOT elta DOT co DOT il> NNTP-Posting-Host: ibm21.acad.cai.cam.ac.uk X-Newsreader: Forte Free Agent 1.21/32.243 To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com On Fri, 18 May 2001 12:53:19 +0300, "Eli Zaretskii" wrote: > >Your call puts a NULL pointer into the argv[] array passed to the >child program. That's invalid usage: argv[] should at least have the >argv[0] element non-NULL. > >Here's the correct way of doing this: > > char *argv[] = { "gcc", NULL }; > > if (spawnvp(P_WAIT, "gcc", argv) == -1) > printf ("spawn...() error!\n"); Incidentally, is there any way of calling a program with a command line longer than 128 characters if it wasn't compiled by djgpp? I'm thinking specifically of an executeable copy I have of lame where command lines are liable to run to a couple of hundred characters. (full path of input and output files, track information and encoding options) -- "You have viruses, but I have resistance, and I am alive, and you- are dead." Ken Macleod The Star Fraction