Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- open Lwt
- let other ic =
- lwt blah = Lwt_io.read ~count:8 ic in
- return ()
- let load fn =
- Lwt_io.with_file
- ~flags:Unix.( [O_CREAT;O_WRONLY (* <- here's the bug *) ;O_TRUNC ] )
- ~perm:0o644
- ~mode:Lwt_io.input
- fn
- (fun ic ->
- lwt s = other ic in
- wrap (fun () -> return 1234))
- let main () = load Sys.argv.(1)
- let _ =
- Lwt_main.run (main ())
- (* Compile with:
- ocamlfind ocamlc -c -g -syntax camlp4o -package lwt -package lwt.syntax -thread -ppopt -lwt-debug -o bar.cmo bar.ml && ocamlfind ocamlc -linkpkg -g -syntax camlp4o -package lwt -package lwt.unix -package lwt.syntax -thread -ppopt -lwt-debug bar.cmo -o bar
- $ OCAMLRUNPARAM=b ./bar fofo
- Fatal error: exception Unix.Unix_error(3, "read", "")
- Raised at file "src/core/lwt.ml", line 782, characters 22-23
- Called from file "src/unix/lwt_main.ml", line 34, characters 8-18
- Called from file "bar.ml", line 20, characters 2-24
- *)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement