You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Original bug ID: 7342 Reporter:@protz Assigned to:@protz Status: resolved (set by @gasche on 2016-12-16T02:49:50Z) Resolution: fixed Priority: normal Severity: minor Version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1 Category: platform support (windows, cross-compilation, etc) Monitored by: dsheets @gasche@hcarty
Bug description
Reading Didier and Xavier's excellent "Unix programming in OCaml" course, I performed a Unix.read on a descriptor, expecting to read 0 when the descriptor had nothing left in it.
Sadly, I was developing on Windows. It turns out that Unix.read throws EPIPE there instead (see ocsigen/lwt#20 for another project that performed a workaround there).
The workaround is to remove the "when false" clause in Test.ml.
Additional information
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?
As a mostly-unix programmer I would have a preference for the documented behavior (also in man 3 read on the C side) to work reliably on Windows -- I'm sure I would have been confused by the issue if people tried my software on Windows.
Original bug ID: 7342
Reporter: @protz
Assigned to: @protz
Status: resolved (set by @gasche on 2016-12-16T02:49:50Z)
Resolution: fixed
Priority: normal
Severity: minor
Version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Target version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Fixed in version: 4.05.0 +dev/beta1/beta2/beta3/rc1
Category: platform support (windows, cross-compilation, etc)
Monitored by: dsheets @gasche @hcarty
Bug description
Reading Didier and Xavier's excellent "Unix programming in OCaml" course, I performed a
Unix.read
on a descriptor, expecting to read 0 when the descriptor had nothing left in it.Sadly, I was developing on Windows. It turns out that
Unix.read
throwsEPIPE
there instead (see ocsigen/lwt#20 for another project that performed a workaround there).Steps to reproduce
See the attached file.
The workaround is to remove the "when false" clause in Test.ml.
Additional information
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?
File attachments
The text was updated successfully, but these errors were encountered: