caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: julien.michel@etu.univ-orleans.fr
To: caml-list@yquem.inria.fr
Subject: opening/reading a rtai fifo
Date: Wed, 24 May 2006 18:47:33 +0200	[thread overview]
Message-ID: <1148489253.44748e25b2321@webmailetu.univ-orleans.fr> (raw)

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.
It behaves like if the input_line function failed to get the end of line
character or whatever...
The same thing occurs using the "input_char" or "open_in_bin" functions...

Would anybody know the convenient functions to perform that ?

Thanks a lot


-- 
MICHEL Julien








             reply	other threads:[~2006-05-24 16:47 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-05-24 16:47 julien.michel [this message]
2006-05-24 17:14 ` [Caml-list] " Basile STARYNKEVITCH
2006-05-24 17:20 ` Eric Cooper
2006-05-24 17:32   ` Basile STARYNKEVITCH

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1148489253.44748e25b2321@webmailetu.univ-orleans.fr \
    --to=julien.michel@etu.univ-orleans.fr \
    --cc=caml-list@yquem.inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).