Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!att!tut.cis.ohio-state.edu!usenet.ins.cwru.edu!odin!chet From: chet@odin.INS.CWRU.Edu (Chet Ramey) Newsgroups: comp.unix.questions Subject: Re: File types Message-ID: <1991Jan10.130009.3973@usenet.ins.cwru.edu> Date: 10 Jan 91 13:00:09 GMT References: <25397@adm.brl.mil> <127561@linus.mitre.org> Sender: news@usenet.ins.cwru.edu Reply-To: chet@po.CWRU.Edu Organization: Case Western Reserve Univ. Cleveland, Ohio, (USA) Lines: 17 Nntp-Posting-Host: odin.ins.cwru.edu In article <127561@linus.mitre.org> dean@snkoil.mitre.org (Dean Cookson) writes: >Anyone know any easy way for a program to check if the argument it was >given as an input file is a directory?? I've been using stat, but >whatever more uses seems faster. 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. Chet -- Chet Ramey ``There's just no surf in Network Services Group Cleveland, U.S.A. ...'' Case Western Reserve University chet@ins.CWRU.Edu My opinions are just those, and mine alone.