correct isatty usage

Nagesh Pabbisetty Pabbisetty.henr at xerox.com
Thu Feb 23 00:17:22 AEST 1989


> I am trying to use this invokation:
>
>         if (isatty (stdin))


Use the following segment of code:

	if (isatty(fileno(stdin))) {
  	        printf("Hello> ");
   	       fflush(stdout);
   	       }

Reason why (isatty (stdin)) will not work:

	isatty requires a file descriptor as an argument but you were trying to
	use it with a file pointer.
	
	 
	
Hope this helps...

Nagesh
716-427-1827 / 5458



More information about the Comp.unix.questions mailing list