Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!uc!nic.MR.NET!thor.acc.stolaf.edu!mike From: mike@thor.acc.stolaf.edu (Mike Haertel) Newsgroups: comp.unix.wizards Subject: Re: stat of i-node Message-ID: <5321@thor.acc.stolaf.edu> Date: 2 Sep 89 18:52:49 GMT References: <172@bmers58.UUCP> <19362@mimsy.UUCP> <179@bmers58.UUCP> Reply-To: mike@thor.stolaf.edu () Organization: St. Olaf College, Northfield, MN Lines: 17 In article <179@bmers58.UUCP> davem@bmers58.UUCP (Dave Mielke) writes: >In article <19362@mimsy.UUCP> chris@mimsy.UUCP (Chris Torek) writes: >>fstat() is a very cheap operation. stat() is a bit more expensive, but >>(with name cacheing) not all that bad. >The problem with fstat is that it requires an open which also does a >name lookup. This proves to be very slow when the directories get >large. I need a way to get the information that stat would return >without the expense of a name lookup. stat() in a simple file name in the current directory ought to be pretty fast. in 4.3BSD if you stat() the files of a directory in sequence of the actual directory entries, the kernel remembers where the previous search left off and does even better. -- Mike Haertel ``There's nothing remarkable about it. All one has to do is hit the right keys at the right time and the instrument plays itself.'' -- J. S. Bach