--- In ocaml_beginners%40yahoogroups.com">ocaml_beginners
yahoogroups.com, "drehman27" <drehman27
...> wrote:
>
> The following code gives me an error message:
> Fatal error: exception Sys_error("Bad file descriptor")
>
> 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" error.
>
> What is wrong with this code?
> Thanks
>
> 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
.