Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!know!sdd.hp.com!hp-pcd!hpcvia!brianh From: brianh@hpcvia.CV.HP.COM (brian_helterline) Newsgroups: comp.lang.c Subject: Re: Redirection question Message-ID: <31530029@hpcvia.CV.HP.COM> Date: 13 Nov 90 16:56:40 GMT References: Organization: Hewlett-Packard Co., Corvallis, Oregon Lines: 28 >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@faui09.informatik. * madguitar * 8070 Ingolstadt * 52126 * uni-erlangen.de * or just mad ----------