peeking into stdin (programing question)

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Nick Estes
Date:  
Subject: peeking into stdin (programing question)
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 -
> http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss
>