let read_file f = let i = open_in f in let buf = Buffer.create 42 in let rec loop () = try Buffer.add_channel buf i 1; loop () with _ -> () in loop (); close_in i; Buffer.contents buf