peeking into stdin (programing question)

Nick Estes plug-discuss@lists.plug.phoenix.az.us
Sat, 8 Jun 2002 18:01:35 -0700 (MST)


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

see termios(3) for setting it to raw mode; specifically the function
cfmakeraw (same man page) is what you're looking for.

	--Nick


On Sat, 8 Jun 2002, John (EBo) David wrote:

> Nick Estes wrote:
> >
> > -----BEGIN PGP SIGNED MESSAGE-----
> > Hash: SHA1
> >
> > Use select or poll (I prefer poll personally, but they both work)
>
> ok... this works except I cannot see or read the character until I type
> a CR.  How do I set stdin to be RAW (similar to ncursers cbreak)?
>
> I tried modifying the file descriptor with:
>
>     if (-1 == fcntl(fileno(stdin), F_SETFL, O_NONBLOCK|O_NDELAY)) /* and
> tried it without delay */
>       return 1;
>
> and reopending stdin with:
>
>   in = open ("/dev/stdin", O_RDONLY| O_NONBLOCK | O_NDELAY);
>
> but I'm still unable to get info back until I type a RETURN.
>
>   EBo --
>
>
> > > sorry for the simple programing question.  I've done this before and
> > > spaced how.
> > >
> > > I need to check if there is input in the standard input in both C and
> > > C++.  If there is then processit, otherwise keep on going.
> > >
> > > can someone hit me with a clue stick?
> ________________________________________________
> See http://PLUG.phoenix.az.us/navigator-mail.shtml if your mail doesn't post to the list quickly and you use Netscape to write mail.
>
> PLUG-discuss mailing list  -  PLUG-discuss@lists.plug.phoenix.az.us
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: pgpenvelope 2.10.2 - http://pgpenvelope.sourceforge.net/

iD8DBQE9Aqjyv+hjYTGg7s4RAg5GAJ9ifU8duRikeDpGTP1hiksRs9575gCeODZv
FYV4QbFCpBN9DxyeJypg9Mo=
=EO6O
-----END PGP SIGNATURE-----