[Chicago-talk] distinguishing between tped input and scanned input.

Richard Reina richard at rushlogistics.com
Fri Apr 15 05:28:43 PDT 2005

> Instead of doing blocking reads use a polling read
> on
> the raw device. The Camel documentation for "select"
> describes this in some detail. The trick is to read
> bytes from your input data stream until you get the
> number of bytes, with a timeout that avoids
> accidentally
> blocking on the port.
> If you put the keyboard temporarily into raw mode
> you'll
> get the individual bytes; when you get five of them
> just
> flush the input stream and put it back in cooked
> mode
> (readkey does most of this for you but sysread +
> select
> gives finer control).
> The point is to suck in bytes as they happen, which
> requires being in raw mode.


Thanks for the response.  This would have been a very
elegant solution, but I took the easy way out
(recommended by Warren) and reconfigured my scanner.

Thnaks nonetheless,


A people that values its privileges above its principles soon loses both.   -Dwight D. Eisenhower.

More information about the Chicago-talk mailing list