off topic: How to read input from keyboard by the Std. C?

John Summerfield debian at herakles.homelinux.org
Sat Dec 11 00:23:13 UTC 2004


On Saturday 11 December 2004 02:14, Vinicius wrote:
> how to read input from keyboard (through a console) by the standard
> language C, please? I suppose an experienced Unix/Linux programmer has
> the answer.

Do you mean frpm stdin (which others assume)? Or from the actual terminal? 
Several programs do the latter, I think passwd, sudo and su all do so.

Basically you need to open /dev/tty, but there is more to it than just that - 
eg what if there is no /dev/tty?

Reading programs that do what you want is a good way to learn.

-- 

Cheers
John Summerfield
tourist pics: http://environmental.disaster.cds.merseine.nu/




More information about the fedora-list mailing list