From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on polar.synack.me X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00 autolearn=ham autolearn_force=no version=3.4.4 X-Google-Thread: 103376,1c1739e9e6a4a7c5 X-Google-Attributes: gid103376,public X-Google-Language: ENGLISH,ASCII-7-bit Path: g2news1.google.com!postnews.google.com!g14g2000cwa.googlegroups.com!not-for-mail From: "jimmaureenrogers@worldnet.att.net" Newsgroups: comp.lang.ada Subject: Re: binding to C: popen Date: 21 Feb 2006 07:25:33 -0800 Organization: http://groups.google.com Message-ID: <1140535533.025063.163680@g14g2000cwa.googlegroups.com> References: <43fb258f$0$170$edfadb0f@dread11.news.tele.dk> NNTP-Posting-Host: 209.194.156.4 Mime-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" X-Trace: posting.google.com 1140535542 21977 127.0.0.1 (21 Feb 2006 15:25:42 GMT) X-Complaints-To: groups-abuse@google.com NNTP-Posting-Date: Tue, 21 Feb 2006 15:25:42 +0000 (UTC) In-Reply-To: <43fb258f$0$170$edfadb0f@dread11.news.tele.dk> User-Agent: G2/0.2 X-HTTP-UserAgent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0),gzip(gfe),gzip(gfe) Complaints-To: groups-abuse@google.com Injection-Info: g14g2000cwa.googlegroups.com; posting-host=209.194.156.4; posting-account=SqOfxAwAAAAkL81YAPGH1JdBwpUXw9ZG Xref: g2news1.google.com comp.lang.ada:3038 Date: 2006-02-21T07:25:33-08:00 List-Id: Poul-Erik Andreasen wrote: > This ictually going as it is suppose to, but i would like set in an > exception if the piping dosn't have succes. Acording to the C manual > popen returns null if it fails. But how do i test on that in the FILEs type? The popen man page describes the command as: FILE *popen(const char *command, const char *mode); Note that popen returns a file pointer. Upon failure it returns a null pointer. It seems that you might be able to test if the return value is null. Jim Rogers