Xref: utzoo comp.unix.questions:31904 comp.unix.programmer:1975 Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!uunet!stanford.edu!leland.Stanford.EDU!dkeisen From: dkeisen@leland.Stanford.EDU (Dave Eisen) Newsgroups: comp.unix.questions,comp.unix.programmer Subject: Re: How do I tell if STDIN is a PIPE? Message-ID: <1991Jun3.175117.9882@leland.Stanford.EDU> Date: 3 Jun 91 17:51:17 GMT References: <653@eskimo.celestial.com> <1991Jun3.141144.23620@leland.Stanford.EDU> <1991Jun3.150851.21915@prl.dec.com> Distribution: world,local Organization: Sequoia Peripherals, Inc. Lines: 18 In article <1991Jun3.150851.21915@prl.dec.com> boyd@prl.dec.com (Boyd Roberts) writes: >You don't test for anything that way. This: > > if ((sb.st_mode & S_IFMT) == S_IFIFO) > >is the way it's done (unless you have those gory POSIX macros). But, Of course, it is (my brain slipped when I was typing and I wrote S_IFREG in place of S_IFMT). That still doesn't change the point of my posting --- on this machine (running ULTRIX 4.1), sb.stmode & S_IFMT is 0 for a pipe. -- Dave Eisen dkeisen@leland.Stanford.EDU 1101 San Antonio Road, Suite 102 Mountain View, CA 94043 (415) 967-5644