Redirection question

brian_helterline brianh at hpcvia.CV.HP.COM
Wed Nov 14 03:56:40 AEST 1990


>Hi net-people,

>perhaps someone out there can help me.

>Is there a _portable_ way to recognize whether input comes from
>stdin or from another stream ?
>To make the problem clearer : i'm working on a programm that takes
>its input from stdin. If however someone chooses to redirect the input
>to a file, so that data is read from that file, how can I figure that
>out ( Prompting and so on should not occur in this case ) ???
	
	Check out isatty()

>The solution should at least work on UNIX _AND_ MS-DOS, so i'm looking for
>a _portable_ implementation.
>Help out there ?
>	Thanks in advance
>		Roberto




--
please contact ( no commercials please )
* Roberto Armenti    *   Voice   *  For E-Mail                  * On IRC
* Wielandstrasse 6   *   0841/   *  roarment at faui09.informatik. * madguitar
* 8070 Ingolstadt    *   52126   *  uni-erlangen.de             * or just mad
----------



More information about the Comp.lang.c mailing list