Version française
Home     About     Download     Resources     Contact us    
Browse thread
[Caml-list] really_input won't read in an entire file...
[ Home ] [ Index: by date | by threads ]
[ Search: ]

[ Message by date: previous | next ] [ Message in thread: previous | next ] [ Thread: previous | next ]
Date: -- (:)
From: Jonathan Roewen <jonathan.roewen@g...>
Subject: [Caml-list] really_input won't read in an entire file...
Hi,

Here's an example running in the toplevel, which doesn't seem to work:

# let ic = open_in "C:/texture.raw";;
val ic : in_channel = <abstr>
# let len = in_channel_length ic;;
val len : int = 196608
# let buf = String.create len;;
val buf : string = ....
# really_input ic buf 0 len;;
Exception: End_of_file.

Is reading it chunk-by-chunk the only reliable way to read in an
entire file? Seems fairly useless to me...

Jonathan