2011/03/20: stdin vs /dev/tty

Ever wondered how tools like more access both, their standard input and the terminal? The trick is to read stdin as usual and do an explicit fopen("/dev/tty","r") to have a file descriptor to read the console input.

Happy playing with your own variation of more! (Mine displays the text in several columns to make better use of the screen.)