I want to make a wrapper around stockfish (chess engine) that uses UCI (Universal chess interface). Running stockfish from the terminal will open its shell:
Stockfish 8 64 by T. Romstad, M. Costalba, J. Kiiski, G. Linscott
|
(where I - cursor)
it waits input commands (like go, position, setoption, etc...)
I need to read output of e.g. go command.
It is the same if i wanted to receive select * from * connecting to database with mysql, psql or another DBMS executable or to read some output from python command using python executable
I'm using linux, but crossplatform solutions are more preferable
I tried to make a program using popen and fscanf in while loop but i guess i need something non-blocking current thread while waiting output from stdout