Mailing list for all users of the OCaml language and system.
 help / color / mirror / Atom feed
* The Unix module & records
@ 2000-05-12 16:55 Amit Dubey
  2000-05-12 17:39 ` Jean-Christophe Filliatre
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Amit Dubey @ 2000-05-12 16:55 UTC (permalink / raw)
  To: caml-list


	Hi,

	I'm still in the process of learning caml, but I'm considering
using it for a project that I'm working on.  One of the first things
I need to do is to figure out how to load a file!  I've tried the following
code:

1: let main () =
2:        let file_info : Unix.stats = Unix.stat Sys.argv.(1) in
3:        let fd = Unix.openfile Sys.argv.(1) [ Unix.O_RDONLY ] perm in
4:        let buffer = ref "" in
5:        let bytes_read = Unix.read (fd) (buffer) (file_info.st_size) in
	<snipped>

But it fails with the error "Unbound record field label st_size" on line 5.
I can't explain why this is happening; looking at the Unix.ml file, I see
the st_size field in the Unix.stats record.  Any suggestions would be
appreciated.

Thanks,
Amit Dubey




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

end of thread, other threads:[~2000-05-14 21:16 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-05-12 16:55 The Unix module & records Amit Dubey
2000-05-12 17:39 ` Jean-Christophe Filliatre
2000-05-12 23:34 ` Markus Mottl
2000-05-13 11:30 ` Gerd Stolpmann

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox