Skip to content

Instantly share code, notes, and snippets.

@shubhamkumar13
Created June 19, 2021 11:06
Show Gist options
  • Save shubhamkumar13/f15296a9758b6dfce21935a7aff736f8 to your computer and use it in GitHub Desktop.
Save shubhamkumar13/f15296a9758b6dfce21935a7aff736f8 to your computer and use it in GitHub Desktop.
how to read a file in ocaml as a string
let read_whole_file filename =
let ch = open_in filename in
let s = really_input_string ch (in_channel_length ch) in
close_in ch;
s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment