Xref: utzoo comp.unix.questions:31918 comp.unix.programmer:1981 Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!zaphod.mps.ohio-state.edu!swrinde!elroy.jpl.nasa.gov!decwrl!pa.dec.com!decprl!decprl!boyd From: boyd@prl.dec.com (Boyd Roberts) Newsgroups: comp.unix.questions,comp.unix.programmer Subject: Re: How do I tell if STDIN is a PIPE? Message-ID: <1991Jun4.100025.29803@prl.dec.com> Date: 4 Jun 91 10:00:25 GMT References: <653@eskimo.celestial.com> <1991Jun3.141144.23620@leland.Stanford.EDU> <1991Jun3.150851.21915@prl.dec.com> <1991Jun3.175117.9882@leland.Stanford.EDU> Sender: news@prl.dec.com (USENET News System) Reply-To: boyd@prl.dec.com (Boyd Roberts) Distribution: world,local Organization: Digital Equipment Corporation - Paris Research Laboratory Lines: 18 In article <1991Jun3.175117.9882@leland.Stanford.EDU>, dkeisen@leland.Stanford.EDU (Dave Eisen) writes: > > 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. > Yep, that really sucks. stat(2) on a pipe(2) returns with st_mode == 0. But, stat(2) on a named pipe returns with st_mode == S_IFIFO | . I just checked this out on my 3max (ULTRIX prl313 4.2 0 RISC). Neat kernel work, guys... real neat. Boyd Roberts boyd@prl.dec.com ``When the going gets wierd, the weird turn pro...''