List Info

Thread: "ocaml_beginners"::[] Re: help with map_file




"ocaml_beginners"::[] Re: help with map_file
user name
2006-11-20 23:34:03

--- In ocaml_beginners%40yahoogroups.com">ocaml_beginnersyahoogroups.com, "drehman27" <drehman27...> wrote:
&gt;
> The following code gives me an error message:
> Fatal error: exception Sys_error("Bad file descriptor")
&gt;
> movies_file is a binary file that I created with my program. It
> contains 32 bit integers (type int).
>; I tried using dims = -1 but I get a "Permission denied&quot; error.
&gt;
> What is wrong with this code?
>; Thanks
&gt;
> let data =
> let fd = Unix.openfile movies_file [Unix.O_RDONLY] 0o444 in
> let kind = Bigarray.int in
> let dims = (Unix.fstat fd).Unix.st_size in
> Bigarray.Array1.map_file fd kind Bigarray.c_layout true dims

solved: true -> false

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )