Path: utzoo!attcan!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!uunet!auspex!guy From: guy@auspex.UUCP (Guy Harris) Newsgroups: comp.unix.questions Subject: Re: Bit pattern of S_IFREG (was Re: What is wrong with this code ?) Message-ID: <2736@auspex.UUCP> Date: 18 Dec 89 23:32:39 GMT References: <1156@nsscb.UUCP> <1323@mitisft.Convergent.COM> <2722@auspex.UUCP> <553@mwtech.UUCP> Reply-To: guy@auspex.auspex.com (Guy Harris) Organization: Auspex Systems, Santa Clara Lines: 11 >I think I have seen on some older systems, that for regular files >you must test for both (st_mode & S_IFMT) == S_IFREG >and *additionally* (st_mode & S_IFMT) == 0. > >I don't know if this is still true today. If it is true on any "V7 derivative" (BSD and S3/S5 count under this heading), it is due to a colossal screwup on the part of the vendor. It may have been true under some emulation of V7 under "last V6", or something like that. *I* certainly wouldn't bother testing for (st_mode & S_IFMT) being 0.