List Info

Thread: "ocaml_beginners"::[] Problems with Unix.open_process




"ocaml_beginners"::[] Problems with Unix.open_process
country flaguser name
United States
2007-09-29 16:24:31

Suprisingly this works fine on Windows but I'm having problems on Unix.

I'm trying to interface with various chess engines that send text back and
forth on stdin and stdout. When the engines start, they each print some
basic introductory info that I need to ignore before we start passing moves
back and forth. On windows, I could look at the input channel and grab the
appropriate text. When I try to do this on Suse, things hang indefinately,
even when I just try to do an "input_char";. Running the same command
("gunchess -x") from the command line immediately returns output. I did use
open_process_full to see if something failed and was sending output on
stderr, but that also blocks.

A simplified version of the code that works on Windows but not Suse is:

let in_chan,out_chan = Unix.open_process "gnuchess -x";;
input_line in_chan;;

Anyone have any tips?

Thanks,

Grant

__._,_.___
.

__,_._,___
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )