Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!news.cs.indiana.edu!maytag!xenitec!iguana!merce From: merce@iguana.uucp (Jim Mercer) Newsgroups: comp.lang.c Subject: help with popen() Message-ID: <1991Feb6.053237.11051@iguana.uucp> Date: 6 Feb 91 05:32:37 GMT Sender: merce@iguana.uucp (Jim Mercer) Distribution: na Organization: Ed (the iguana) Memorial Society Lines: 39 a snippet of code: char *p_value; FILE *F_pipe; ... [ p_value points to "no_such_file" ] F_pipe = popen(p_value, "r"); if (F_pipe == NULL) { fprintf(stderr, "failure opening pipe (%s)\n", p_value); return(!OK); } ... pclose(F_pipe); intention: open a pipe to a process, use fgets to read input, warn user on pipe failure. question: when i run this on my 3b1, CTIX (SysV 2+ sort of), i get "sh: no_such_file: not found" on stderr. but, according to the if, F_pipe is not NULL. works fine if p_value points to an existing command. according to my documentation (Advanced Programmer's Guide to Unix System V, McGraw-Hill), "popen() returns NULL if _command_ cannot be started". am i doing something wrong? is my popen() broken? -- [ Jim Mercer work: jim@lsuc.on.ca home: merce@iguana.uucp +1 519 570-3467 ] [ "I am pro-military. I am not pro-war. There is a big difference" ] [ -- Louise Mandrell (Toronto Sun) ]