Path: utzoo!attcan!utgpu!utstat!jarvis.csri.toronto.edu!mailrus!wuarchive!gem.mps.ohio-state.edu!lavaca.uh.edu!uhnix1!moray!urchin!p6.f506.n106.z1.fidonet.org!Bob.Stout From: Bob.Stout@p6.f506.n106.z1.fidonet.org (Bob Stout) Newsgroups: comp.lang.c Subject: spawn of.....hell, I can't get it to work Message-ID: <2345.255A7CD9@urchin.fidonet.org> Date: 9 Nov 89 11:12:33 GMT Sender: ufgate@urchin.fidonet.org (newsout1.26) Organization: FidoNet node 1:106/506.6 - Fulcrum's Edge, Spring TX Lines: 17 In an article of <6 Nov 89 07:33:21 GMT>, (Bob Calbridge) writes: >.... I invoke spawn in the form > >spawn (P_WAIT, defaults.dflt_ed, defaults.last_file, NULL); Try instead: spawnlp(P_WAIT, defaults.dflt_ed, defaults.deflt_ed, defaults.last_file, NULL); The spawnlp() function, means that the arguments are passed in the call as a NULL terminated list and that the PATH is searched to find the program to be executed. The first reference to defaults.dflt_ed is the actual name of the program to be spawned. The second is argv[0] and unused by DOS, but still required. Finally the arguments are passed beginning with argv[1] which, in your case, is defaults.last_file.