comp.lang.ada
 help / color / mirror / Atom feed
From: Poul-Erik Andreasen <poulerik@pea.dk>
Subject: Re: binding to C: popen
Date: Tue, 21 Feb 2006 16:45:40 +0100
Date: 2006-02-21T16:45:40+01:00	[thread overview]
Message-ID: <43fb35a4$0$178$edfadb0f@dread11.news.tele.dk> (raw)
In-Reply-To: <1140535533.025063.163680@g14g2000cwa.googlegroups.com>

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



  reply	other threads:[~2006-02-21 15:45 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
2006-02-21 15:45   ` Poul-Erik Andreasen [this message]
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