Guest User

Untitled

a guest
Jun 12th, 2018
101
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
OCaml 0.79 KB | None | 0 0
  1. let log f s =
  2.   Lwt_unix.openfile f [Lwt_unix.O_APPEND; Lwt_unix.O_CREAT] 0o640 >>= fun o ->
  3.   Lwt_unix.write o s 0 (String.length s)
  4.  
  5. let () = Lwt_main.run (log "/var/log/cwb.log" "some message\n");;                                                                                                                                                                      
  6. Error: This expression has type int but an expression was expected of type unit                                                              
  7.  
  8. let t = Lwt_main.run (log "/var/log/cwb.log" "some message\n");;                                                                                                                                                                        
  9. Exception: Unix.Unix_error (Unix.EBADF, "write", "").
Add Comment
Please, Sign In to add comment