Jonathan Roewen wrote:
> Hi,
>
> IO.read_all doesn't return anything from my input stream.
>
> Console.printf "%s" (IO.read_all fin) => ""
>
> The following code works perfectly, however:
>
> try while true do
> Console.printf "%c" (IO.read fin)
> done with _ -> () => contents of the stream.
>
> Jonathan
>
Are you using an input stream "type" defined in IO or a custom one? If
the latter, are you absolutely sure it adheres to the IO standard?
You can see the full standard at
http://ocaml-programming.de/rec/IO-Classes.html
Of course, the page only defines the class-based interface, but the
behavior of IO.t streams should be identical.
--
Bardur Arantsson
<ba...@im...>
<ba...@sc...>
- New York now leads the world's great cities in the number of
people around whom you shouldn't make a sudden move.
David Letterman, 'The Late Show'
|