On 29-05-2008, John Whitington <[EMAIL PROTECTED]> wrote: > Hullo. > > I'm compiling OCaml command-line software with the MSVC toolchain on > Windows. Users have noticed two problems: > > (b) Chaining invocations of the tool together using pipes on Windows > often fails. The second process in the chain gets an End_Of_File after > only a few hundred bytes of data. I've confirmed the data is all being > output by the first process, and the first process is exiting cleanly. > All the open_in and open_out calls are using the _bin variant. The > data being sent down the pipe is a PDF file (which contains binary > sections). > > Neither of these problems occur on Linux / Mac builds - is there > something about windows pipes I should know? >
Yep, on windows GetStdHandle doesn't always return the same kind of handle depending on the context: - if the output/input is console, it is console handle (i.e. need to be manipulated through console function) - if the output/input is a pipe, it is a pipe handle (i.e. need to be manipulated through pipe function) And since we are in the good old world of windows, the return type is an HANDLE whatever it is ;-) I think your issue is related to this difference. It can be fixed, but you need a little bit of knowledge about windows pipe/standard handle. Regards, Sylvain Le Gall _______________________________________________ Caml-list mailing list. Subscription management: http://yquem.inria.fr/cgi-bin/mailman/listinfo/caml-list Archives: http://caml.inria.fr Beginner's list: http://groups.yahoo.com/group/ocaml_beginners Bug reports: http://caml.inria.fr/bin/caml-bugs