comp.lang.ada
 help / color / mirror / Atom feed
From: sk <noname@myob.com>
To: comp.lang.ada@ada.eu.org
Subject: Re: Running external program, getting output
Date: Wed, 25 Jun 2003 21:04:31 -0500
Date: 2003-06-25T21:04:31-05:00	[thread overview]
Message-ID: <mailman.14.1056592215.8204.comp.lang.ada@ada.eu.org> (raw)
In-Reply-To: m2n0g5hoy7.fsf@maskin.flamestrike.no-ip.org

Whether you choose "popen" binding or AdaCL (I have not
looked at AdaCL yet), you probably do not want to use the
"Gnat.Os_Lib" spawn functions as well.

If you look at the source for Gnat.Os_Lib.Spawn, and follow
the code trail to the "C" source file "a-adainit.c", function
"__gnat_portable_spawn", you will see the typical

fork ()
if child then

     -- do child stuff

else -- if parent

     -- do parent stuff

end if;

So, if you use Gnat.Os_Lib.Spawn and also implement "popen",
or similar, you will probably end up with a double spawn;
a situation *I* would prefer to avoid.

If you choose to implement yourself, rather than use either
J.Rogers "popen" binding or the AdaCL package(s), you might
use "__gnat_portable_spawn" as a starting point for your own
efforts.

-- 
-------------------------------------------------
-- Merge vertically for real address
--
--     s n p @ t . o
--      k i e k c c m
-------------------------------------------------




  reply	other threads:[~2003-06-26  2:04 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-06-22 11:51 Running external program, getting output Jarle Thorsen
2003-06-22 13:07 ` Ludovic Brenta
2003-06-22 13:43   ` sk
2003-06-22 15:39     ` Jarle Thorsen
2003-06-22 19:21       ` David C. Hoos
2003-06-22 19:25       ` sk
2003-06-22 17:20 ` Martin Krischik
2003-06-25 20:39   ` Jarle Thorsen
2003-06-26  2:04     ` sk [this message]
2003-06-27 17:47     ` Warren W. Gay VE3WWG
replies disabled

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