Skip to content

Commit

Permalink
Minor tweak to Spin_std.Sys read/write
Browse files Browse the repository at this point in the history
  • Loading branch information
mbarbin committed Nov 24, 2021
1 parent d96fc28 commit 998f08d
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions lib/spin_std/sys.ml
Expand Up @@ -93,11 +93,9 @@ let write_file file content =
~finally:(fun () -> close_out oc)

let read_file file =
let ic = open_in file in
let ic = open_in_bin file in
Fun.protect
(fun () ->
let length = in_channel_length ic in
let buffer = Bytes.create length in
really_input ic buffer 0 length;
Bytes.to_string buffer)
really_input_string ic length)
~finally:(fun () -> close_in ic)

0 comments on commit 998f08d

Please sign in to comment.