This is mentioned in "Unix system programming in Object Caml"* in section 4.5.  The solution given in the book is wrap the function call in a try...with.  It doesn't feel right to me either, but I don't know if there is a better alternative.

*http://ocamlunix.forge.ocamlcore.org/

On Thu, Oct 28, 2010 at 9:02 AM, Paolo Donadeo <p.donadeo@gmail.com> wrote:
It's a known pitfall. Read this discussion of some months ago:

http://caml.inria.fr/pub/ml-archives/caml-list/2010/08/242cee79bb97e86bc93bc6bd88d2f256.en.html


--
Paolo

_______________________________________________
Caml-list mailing list. Subscription management:
http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list
Archives: http://caml.inria.fr
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
Bug reports: http://caml.inria.fr/bin/caml-bugs