let write_to_file file content = Lwt_io.open_file ~mode:Output file >>= (fun oc-> (fun () -> Lwt_io.fprintf oc "%s\n" content) |> Lwt.async; Lwt_result.return (Lwt_io.close oc))