I'm not expert on task.ijs and Oleg should know this better. However you may
emulate unbuffered behaviour by flushing file buffer after every writing. Google
for "win32 flush file buffer" should return the exact api and usage.
Hop this help.
JC Coez wrote:
Yes, in the task.ijs developped by Oleg Kobchenko, the
WriteFile/ReadFile use handles and win32api. How can i specify
unbuffered versus buffered ?
----- Original Message ----- From: "bill lam" <[EMAIL PROTECTED]>
To: "Programming forum" <[email protected]>
Sent: Sunday, April 01, 2007 6:10 PM
Subject: Re: [Jprogramming] stdin/stdout
JC Coez wrote:
I used "spawn" (from task.ijs) and I understand now that the chess
engine is always requiring some data and loops with a reply such as
'invalid command,try...' until the variable which receives the data
is 32meg. and J hangs... I don't know how to modify the ReadAll so
that the loop would not occur and the process would only wait until
new data colud be sent to the engine. Is that possible ?
Assuming the chess engine has unbuffered stdin/stdout, you may tried
use win32 api to obtain the handle of stdin/stdout and set them
unbuffered. And then use these handles for i/o instead of J 1!:xxx
conjunctions.
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
---------------------------------------------------------------------------------------
Orange vous informe que cet e-mail a ete controle par l'anti-virus
mail. Aucun virus connu a ce jour par nos services n'a ete detecte.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm
--
regards,
bill
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm