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!news3.google.com!news4.google.com!news.glorb.com!news.tele.dk!feed118.news.tele.dk!not-for-mail Date: Tue, 21 Feb 2006 16:45:40 +0100 From: Poul-Erik Andreasen User-Agent: Debian Thunderbird 1.0.2 (X11/20051002) X-Accept-Language: en-us, en MIME-Version: 1.0 Newsgroups: comp.lang.ada Subject: Re: binding to C: popen References: <43fb258f$0$170$edfadb0f@dread11.news.tele.dk> <1140535533.025063.163680@g14g2000cwa.googlegroups.com> In-Reply-To: <1140535533.025063.163680@g14g2000cwa.googlegroups.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Message-ID: <43fb35a4$0$178$edfadb0f@dread11.news.tele.dk> Organization: TDC Totalloesninger NNTP-Posting-Host: 80.166.145.174 X-Trace: 1140536740 dread11.news.tele.dk 178 80.166.145.174:43616 X-Complaints-To: abuse@post.tele.dk Xref: g2news1.google.com comp.lang.ada:3040 Date: 2006-02-21T16:45:40+01:00 List-Id: jimmaureenrogers@worldnet.att.net wrote: > 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 > Yes but a C pointer is in Ada represented as system.address and i can not test that for O the the systems.address_image gives 0804C060 and if that is a stadart c value for a null-pointer things are fine, but that seems to be a hack. Poul-Erik