caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] really_input won't read in an entire file...
@ 2006-04-08 10:58 Jonathan Roewen
  2006-04-10 15:28 ` Gerd Stolpmann
  0 siblings, 1 reply; 3+ messages in thread
From: Jonathan Roewen @ 2006-04-08 10:58 UTC (permalink / raw)
  To: OCaml

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


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

end of thread, other threads:[~2006-04-10 15:31 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2006-04-08 10:58 [Caml-list] really_input won't read in an entire file Jonathan Roewen
2006-04-10 15:28 ` Gerd Stolpmann
2006-04-10 15:31   ` Jonathan Roewen

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