Xref: utzoo comp.unix.questions:32013 comp.unix.programmer:2008 Newsgroups: comp.unix.questions,comp.unix.programmer Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!think.com!snorkelwacker.mit.edu!thunder.mcrcim.mcgill.edu!mouse From: mouse@thunder.mcrcim.mcgill.edu (der Mouse) Subject: Re: How do I tell if STDIN is a PIPE? Message-ID: <1991Jun7.145414.24293@thunder.mcrcim.mcgill.edu> Organization: McGill Research Centre for Intelligent Machines References: <1991May26.172328.713@arizona.edu> <23190@shlump.lkg.dec.com> Distribution: world,local Date: Fri, 7 Jun 91 14:54:14 GMT Lines: 25 In article <23190@shlump.lkg.dec.com>, lan_csse@netrix.nac.dec.com (CSSE LAN Test Account) writes: > In article <653@eskimo.celestial.com> nanook@eskimo.celestial.com (Robert Dinse) writes: >> if(s.st_mode & S_IFIFO) > On this machine (Ultrix 4.1) and on the next one over (Ultrix 3.1), > this code says "Stdin is not a pipe.\n". On investigation, the status > struct was *entirely* filled with null bytes. mtXinu 4.3+NFS stat(2) manpage: .SH BUGS Applying .I fstat to a socket (and thus to a pipe) returns a zero'd buffer, except for the blocksize field, and a unique device and inode number. It seems other systems (like your Ultrices and probably vanilla 4.3) do this as well. der Mouse old: mcgill-vision!mouse new: mouse@larry.mcrcim.mcgill.edu