There is a version of interactive task enhancement at http://www.jsoftware.com/jwiki/OlegKobchenko/Interactive_Task
It uses "naive" wait, which nevertheless works with Windows "more" command. (A more correct approach would require overlapped IO.) However, I believe this should be worth a try. The wait timeouts should be calibrated for particular application. Wait should be done and return non-zero before any read. Try something simple first and see how it goes. --- JC Coez <[EMAIL PROTECTED]> wrote: > It seems to be exactly what happened in my case wth the Arion chess engine. > When you will have some time to solve that please let me know. > > JC Coez > > ----- Original Message ----- > From: "Raul Miller" <[EMAIL PROTECTED]> > To: "Programming forum" <[email protected]> > Sent: Monday, April 02, 2007 9:33 PM > Subject: Re: [Jprogramming] stdin/stdout > > > >I downloaded and installed arasan 9.5 from > > http://www.arasanchess.org/downld.html > > > > I ran arasan.exe, and the gui worked. > > > > I ran arasanx.exe, and the stdio interface worked (I was able to enter > > commands like > > e7e6 and e2e4, and get plausible responses). > > > > In J, I defined: > > spawnio=:3 :0 > > require'task' > > cocurrent 'jtask' > > 'or ow'=.CreatePipe 1 > > 'ir iw'=.CreatePipe 2 > > ph=.(ow,ir) CreateProcess y > > if.1>ph do. > > CloseHandle or,ow,ir,iw > > assert.0 > > end. > > CloseHandle ow,ir > > iw,or > > ) > > > > arasanx=:3 :0 > > spawnio (2!:5'APPDATA'),'\arasanx.exe' > > ) > > > > rd=:ReadAll_jtask_ > > wr=:WriteAll_jtask_ > > > > Then, I tried: > > arasanx'' > > 548 424 > > rd 424 > > > > At this point, my J session "froze". I then went to the OS, and ended the > > arasanx process. As soon as I did this, J returned the text of the first > > line > > from arasanx: > > > > Arasan 9.5 Copyright 1994-2006 by Jon Dart > > > > If I wanted to make this work, I'd have to figure out how to read and > > write lines. (task.ijs does not include a ReadLine verb.) > > > > I think I know how to make this work (actually, I have several ideas > > I could try), but I don't have time to mess with this right now. > > > > -- > > Raul ____________________________________________________________________________________ 8:00? 8:25? 8:40? Find a flick in no time with the Yahoo! Search movie showtime shortcut. http://tools.search.yahoo.com/shortcuts/#news ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
