Join GitHub today
GitHub is home to over 31 million developers working together to host and review code, manage projects, and build software together.Sign up
Unix.read exhibits two different behaviors on Windows vs Linux #7342
Original bug ID: 7342
Reading Didier and Xavier's excellent "Unix programming in OCaml" course, I performed a
Sadly, I was developing on Windows. It turns out that
Steps to reproduce
See the attached file.
# #use "Test.ml";; - : unit = () # run "ls" [||];; Exception: Unix.Unix_error (Unix.EPIPE, "read", "").
The workaround is to remove the "when false" clause in Test.ml.
I can submit a pull request that wraps otherlibs/win32unix/unix.ml:read with that exact try-catch block, or I can submit a documentation request that documents this caveat. Any preference?
Comment author: @gasche
As a mostly-unix programmer I would have a preference for the documented behavior (also in