Message-ID: <3E0EA6CF.51896D97@yahoo.com> From: CBFalconer Organization: Ched Research X-Mailer: Mozilla 4.75 [en] (Win98; U) X-Accept-Language: en MIME-Version: 1.0 Newsgroups: comp.os.msdos.djgpp Subject: Detecting stdin not redirected Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit Lines: 15 Date: Sun, 29 Dec 2002 07:40:30 GMT NNTP-Posting-Host: 12.90.167.143 X-Complaints-To: abuse AT worldnet DOT att DOT net X-Trace: bgtnsc05-news.ops.worldnet.att.net 1041147630 12.90.167.143 (Sun, 29 Dec 2002 07:40:30 GMT) NNTP-Posting-Date: Sun, 29 Dec 2002 07:40:30 GMT To: djgpp AT delorie DOT com DJ-Gateway: from newsgroup comp.os.msdos.djgpp Reply-To: djgpp AT delorie DOT com With gcc and DJGPP, how can a running program detect that stdin has not been redirected from the keyboard? How portable is such a method, i.e. will it hold up for Linux? To allow for use of external terminals, I guess the thing wanted is to detect that stdin is actually a disk file (or a pipe) as opposed to a device. There are bits available with some calls or other in the DOS interrupt group, but I guess the question is how exposed are these, and obviously any such will not be Linux portable. -- Chuck F (cbfalconer AT yahoo DOT com) (cbfalconer AT worldnet DOT att DOT net) Available for consulting/temporary embedded and systems. USE worldnet address!