From mint-bounce@lists.fishpool.fi  Tue Jan 22 17:26:20 2008
X-Original-To: fnaumann@mail.boerde.de
Delivered-To: fnaumann@mail.boerde.de
Message-ID: <4725CB62.5090907@highlandsun.com>
Date: Mon, 29 Oct 2007 05:00:34 -0700
From: Howard Chu <hyc@highlandsun.com>
User-Agent: Mozilla/5.0 (X11; U; Linux i686; rv:1.9a9pre) Gecko/2007100901 SeaMonkey/2.0a1pre
MIME-Version: 1.0
To: Jo Even Skarstein <joska@online.no>
Cc: mint@fishpool.com
Subject: Re: [MiNT] Redirecting stdio using Fforce/Fdup
References: <44180264.137741193650999885.JavaMail.adm-moff@moffice5.nsc.no>
In-Reply-To: <44180264.137741193650999885.JavaMail.adm-moff@moffice5.nsc.no>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
X-ecartis-version: Ecartis v1.0.0
Sender: mint-bounce@lists.fishpool.fi
Errors-To: mint-bounce@lists.fishpool.fi
X-original-sender: hyc@highlandsun.com
Precedence: bulk
List-help: <mailto:ecartis@lists.fishpool.fi?Subject=help>
List-unsubscribe: <mailto:mint-request@lists.fishpool.fi?Subject=unsubscribe>
List-Id: <mint.lists.fishpool.fi>
X-List-ID: <mint.lists.fishpool.fi>
List-subscribe: <mailto:mint-request@lists.fishpool.fi?Subject=subscribe>
List-owner: <mailto:tjhukkan@fishpool.fi>
List-post: <mailto:mint@lists.fishpool.fi>
X-Virus-Scanned: by amavisd-new at relay.boerde.de
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on relay.boerde.de
X-Spam-Status: No, hits=-1.0 tagged_above=-50.5 required=7.0 tests=BAYES_00
X-Spam-Level: 
Status: 
X-Status: 
X-Keywords:                   

Jo Even Skarstein wrote:
> Hi!
> 
> I'm working on a small application that needs to run a .ttp as a child and do some screen scraping on it. Basically I'm building a GEM frontend to an old .TOS-program with a character based UI.
> 
> As I need to run this program under both MiNT and MagiC I can't use pty's, so I assume I must use Fforce/Fdup. The problem is that I don't understand how these calls work, and I'm having trouble finding good documentation and programming examples. Can anyone suggest some readable sources that use these calls, or perhaps explain to me how to use them? It would be extremely helpful :-)
> 
> Jo Even

Those functions are pretty much the same as Unix dup/dup2 system calls. You 
first create a pipe, then Fforce the child's stdout/stderr to write to the 
pipe. Your parent process then reads the pipe to get all of the child's 
output. If you also need to feed input to the child, then you'll also need a 
separate pipe for that, and Fforce it to the child's stdin.
-- 
   -- Howard Chu
   Chief Architect, Symas Corp.  http://www.symas.com
   Director, Highland Sun        http://highlandsun.com/hyc/
   Chief Architect, OpenLDAP     http://www.openldap.org/project/


