caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Named pipe problem: is this a bug?
@ 2005-08-01 15:03 Alan Schmitt
  2005-08-01 15:41 ` [Caml-list] " Virgile Prevosto
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alan Schmitt @ 2005-08-01 15:03 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 894 bytes --]

Hello,

I've stumbled upon a small bug, and I wonder if it's a OS X bug (I'm  
using X.4.2), or a caml bug. The problem is the following: I create a  
named pipe, then I open it. The open system call seems to block until  
there is data in the pipe.

Here is a small program illustrating this:

let _ =
   Unix.mkfifo "pipe_test" 0o640;
   print_endline "pipe created";
   flush stdout;
   let chin = open_in "pipe_test" in
     print_endline "pipe opened";
     flush stdout

Compile it using "ocamlc unix.cma bug.ml" (the bug occurs both in  
bytecode and native code). When a.out is run, one sees:
pipe created
and the program keeps running. If one then does a
echo foo >> pipe_test
then the "pipe opened" line is shown, and the program terminates.

Is this behaviour normal?

Thanks,

Alan Schmitt

-- 
The hacker: someone who figured this out and made something cool happen.
.O.
..O
OOO



[-- Attachment #2: This is a digitally signed message part --]
[-- Type: application/pgp-signature, Size: 186 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2005-08-02  8:01 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2005-08-01 15:03 Named pipe problem: is this a bug? Alan Schmitt
2005-08-01 15:41 ` [Caml-list] " Virgile Prevosto
2005-08-01 15:42 ` Damien Bobillot
2005-08-01 15:55 ` Richard Jones
2005-08-02  7:59 ` Alan Schmitt

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).