July 25th, 2003, 09:35 AM
Nonblocking stdin input?
I'm trying to do a nonblocking read (or scanf, fgets, etc.) from stdin using cygwin running in Windows XP. I've been told here that I cannot do select on stdin in Windows (which is a shame, as that would really fix my problems). Is there a definitive solution for doing a nonblocking read of a '\n' terminated string from stdin?
July 25th, 2003, 12:26 PM
Haven't done any programming on cygwin for windoze, but is the curses library supported? If so, you can probably use timeout() or nodelay() to set non-blocking mode and getch() to read the key pressed.
Up the Irons
What Would Jimi Do? Smash amps. Burn guitar. Take the groupies home.
"Death Before Dishonour, my Friends!!" - Bruce D ickinson, Iron Maiden Aug 20, 2005 @ OzzFest
Down with Sharon Osbourne
"I wouldn't hire a butcher to fix my car. I also wouldn't hire a marketing firm to build my website." - Nilpo