Path: utzoo!attcan!uunet!munnari.oz.au!labtam!cmsfl!nigel From: nigel@cmsfl@labtam.oz (Nigel Harwood) Newsgroups: comp.lang.c Subject: popen() can't tell if cmd fails Keywords: popen() Message-ID: <855@cmsfl> Date: 1 Jul 90 06:44:21 GMT Organization: Coles Myer Ltd., Melbourne, Australia Lines: 23 As a general question, how much use to people make of the popen() function in programs where failures must be detected ? I am working on a program where I would like to use popen() but can see no way of detecting when the command exits with a bad status. At least not easily anyway. Popen() will return a NULL pointer if the creation of the environment to run the command under fail but not if the command fails. So I have instead resorted to using system() and two temporary files which means I am using one temporary file I wouldn't need if popen() would tell me the exit code. Your thoughts ? -- <<<<<<<<<<<<<<<<<<<<<<<<< Nigel Harwood >>>>>>>>>>>>>>>>>>>>>>>>>>> << Post: Coles Myer Ltd, PO Box 2000 Tooronga 3146, Australia >> << Phone: +61 3 829 6090 E-mail: nigel@cnw01.storesys.coles.oz.au >> <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>