summaryrefslogtreecommitdiff
path: root/ocaml/lib/shared/file.ml
blob: 74b5abc3bb1c73e73776260f68db2576951e6658 (plain)
1
2
3
4
5
6
(** [read filename] is the contents of [filename] as a string.
    The empty string is returned if [filename] does not exist. *)
let read filename =
  let chan = In_channel.open_text filename in
  let content = In_channel.input_all chan in
  In_channel.close chan ; content