Why do you need to read "one byte at a time"? (It's probably worth noting that even in C, stdin is typically buffered, so when reading "one byte at a time", the program actually reads more than one byte and stores it in memory and then feeds one byte at a time to the code calling, for example, getchar().)
Also, what OS are you using? Thanks, -- Raul On Sat, Jun 5, 2021 at 10:49 PM Thang <[email protected]> wrote: > > for instance, this script read the whole stdin: > > |#!/bin/jconsole stdout (1!:1) 3 | > > but I need to read one byte at a time. I tried |1!:11| but it doesn't > recognize |3| as stdin. > > |(1!:11) 3;0 1 NB. file number error: script | > > maybe the missing part is to find the fileno associated with the stdin > of the running script's process itself and use the fileno in the |y| of > |(1!:11)|. > > ---------------------------------------------------------------------- > For information about J forums see http://www.jsoftware.com/forums.htm ---------------------------------------------------------------------- For information about J forums see http://www.jsoftware.com/forums.htm
