The idea of spawn io is probably correct. By default the pipes are opened in byte mode.
The freezing may occur because it tries to read past of what is available in the buffer, which is OK if we close pipes as in single session mode. So instead Peek should be used and possibly some kind of wait for reading. On writing, some kind of Flush may be needed. I dont believe ReadLine is necessary or even available for Windows pipes. So what other ideas are there? Maybe someone else can implement them. A simple test case is the windows "more" command, which just echos what is sent. E.g. load'task' 'test'spawn 'cmd /c more' test (1000$'test',LF)spawn 'cmd /c more' test test ... I believe if this be working in interactive mode, all would work. --- Raul Miller <[EMAIL PROTECTED]> wrote: > 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 > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm > ____________________________________________________________________________________ TV dinner still cooling? Check out "Tonight's Picks" on Yahoo! TV. http://tv.yahoo.com/ ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
