Created
June 19, 2021 11:06
-
-
Save shubhamkumar13/f15296a9758b6dfce21935a7aff736f8 to your computer and use it in GitHub Desktop.
how to read a file in ocaml as a string
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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