From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Original-To: caml-list@yquem.inria.fr Delivered-To: caml-list@yquem.inria.fr Received: from concorde.inria.fr (concorde.inria.fr [192.93.2.39]) by yquem.inria.fr (Postfix) with ESMTP id E4650BB83 for ; Wed, 24 May 2006 19:14:07 +0200 (CEST) Received: from kraid.nerim.net (smtp-103-wednesday.nerim.net [62.4.16.103]) by concorde.inria.fr (8.13.0/8.13.0) with ESMTP id k4OHE7XS013338 for ; Wed, 24 May 2006 19:14:07 +0200 Received: from hector.lesours (bstarynk.pck.nerim.net [213.41.244.95]) by kraid.nerim.net (Postfix) with ESMTP id 66FF340E22; Wed, 24 May 2006 19:14:06 +0200 (CEST) Received: from basile by hector.lesours with local (Exim 4.62) (envelope-from ) id 1Fiwvv-0004SZ-AR; Wed, 24 May 2006 19:14:07 +0200 Date: Wed, 24 May 2006 19:14:07 +0200 To: julien.michel@etu.univ-orleans.fr Cc: caml-list@yquem.inria.fr Subject: Re: [Caml-list] opening/reading a rtai fifo Message-ID: <20060524171407.GB16984@ours.starynkevitch.net> References: <1148489253.44748e25b2321@webmailetu.univ-orleans.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-15 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <1148489253.44748e25b2321@webmailetu.univ-orleans.fr> User-Agent: Mutt/1.5.11+cvs20060403 From: Basile STARYNKEVITCH X-Miltered: at concorde with ID 4474945F.003 by Joe's j-chkmail (http://j-chkmail.ensmp.fr)! X-Spam: no; 0.00; basile:01 basile:01 univ-orleans:01 ecrivait:01 sizeof:01 ocaml:01 stdout:01 nerim:01 faiencerie:01 92340:01 reine:01 2006:98 continuously:98 wrote:01 caml-list:01 X-Spam-Checker-Version: SpamAssassin 3.0.3 (2005-04-27) on yquem.inria.fr X-Spam-Level: X-Spam-Status: No, score=0.1 required=5.0 tests=FORGED_RCVD_HELO autolearn=disabled version=3.0.3 Le Wed, May 24, 2006 at 06:47:33PM +0200, julien.michel@etu.univ-orleans.fr écrivait/wrote: > Hello, > I currently work on an embedded system, OS Linux 2.4-19 RTAI . > > I'd like to open and read out an RTAI FIFO (called /dev/rtf/0) > I used to do it with a "C" code such like: > fd = open("/dev/rtf/0",O_RDONLY); > read(fd,&f,sizeof(...)); etc... > > For now, I would like to do that with Ocaml. For instance, to begin, a reading > of the FIFO's first line: > > let c = open_in "/dev/rtf/0" in > let s = input_line c in > print_string s; > close_in c; > > While executing this code, the application seems to run continuously, without > printing anything out whereas it works while using a single text file instead of > the fifo. Julien probably forgot a flush stdout at the end of his code. I sent him a longer email privately in french. -- Basile STARYNKEVITCH http://starynkevitch.net/Basile/ email: basilestarynkevitchnet aliases: basiletunesorg = bstarynknerimnet 8, rue de la Faïencerie, 92340 Bourg La Reine, France