caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* Buffer.add_channel hangs
@ 2010-03-17 20:27 Stas Miasnikou
  2010-03-17 23:20 ` [Caml-list] " Martin Jambon
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: Stas Miasnikou @ 2010-03-17 20:27 UTC (permalink / raw)
  To: caml-list

Hi,

OCaml 3.11.1, OpenBSD 4.6, i386.

I am trying to read whole file by doing:

let read_file_bin name =
  let ic = open_in_bin name in
  let b = Buffer.create 1024 in
  (try Buffer.add_channel b ic max_int with _ -> ()); (* <-- HERE *)
  close_in ic;
  Array.init (Buffer.length b) (fun i -> int_of_char (Buffer.nth b i))

but it hangs on the line marked. Am I doing something wrong?

Stas


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

end of thread, other threads:[~2010-03-20  8:29 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-03-17 20:27 Buffer.add_channel hangs Stas Miasnikou
2010-03-17 23:20 ` [Caml-list] " Martin Jambon
2010-03-18  6:47   ` Stas Miasnikou
2010-03-18  9:09     ` Fabrice Le Fessant
2010-03-18  2:53 ` Goswin von Brederlow
2010-03-18 17:52 ` Stas Miasnikou
2010-03-20  8:29   ` Stas Miasnikou

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