comp.lang.ada
 help / color / mirror / Atom feed
From: "jimmaureenrogers@worldnet.att.net" <jimmaureenrogers@worldnet.att.net>
Subject: Re: binding to C: popen
Date: 21 Feb 2006 07:25:33 -0800
Date: 2006-02-21T07:25:33-08:00	[thread overview]
Message-ID: <1140535533.025063.163680@g14g2000cwa.googlegroups.com> (raw)
In-Reply-To: <43fb258f$0$170$edfadb0f@dread11.news.tele.dk>


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




  reply	other threads:[~2006-02-21 15:25 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-02-21 14:37 binding to C: popen Poul-Erik Andreasen
2006-02-21 15:25 ` jimmaureenrogers [this message]
2006-02-21 15:45   ` Poul-Erik Andreasen
2006-02-21 15:52     ` Georg Bauhaus
2006-02-21 16:16       ` Poul-Erik Andreasen
2006-02-21 16:12     ` Alex R. Mosteo
2006-02-21 23:51     ` Jeffrey R. Carter
2006-02-22 13:50 ` Marc A. Criley
2006-02-23  1:10   ` poulerik
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox