Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!usc!randvax!segue!jim From: jim@segue.segue.com (Jim Balter) Newsgroups: comp.unix.questions Subject: Re: File types Message-ID: <5719@segue.segue.com> Date: 11 Jan 91 21:14:35 GMT References: <25397@adm.brl.mil> <127561@linus.mitre.org> <1991Jan10.130009.3973@usenet.ins.cwru.edu> Reply-To: jim@segue.segue.com (Jim Balter) Organization: Segue Software, Inc. - Santa Monica, CA. +1-213-453-2161 Lines: 8 In article <1991Jan10.130009.3973@usenet.ins.cwru.edu> chet@po.CWRU.Edu writes: >In article <127561@linus.mitre.org> dean@snkoil.mitre.org (Dean Cookson) writes: >Stat is what more uses. You could try opening the file for writing and >checking to see if the open fails with errno == EISDIR, but I don't think >that's any better, and it has to be less portable. Open the file for reading and then do an fstat. That only does one nami, instead of two for stat and open.