Browse thread
Buffer.add_channel hangs
[
Home
]
[ Index:
by date
|
by threads
]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: | 2010-03-17 (20:27) |
From: | Stas Miasnikou <stas.miasnikou@g...> |
Subject: | Buffer.add_channel hangs |
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