Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!agate!paris.Berkeley.EDU!mcgrath From: mcgrath@paris.Berkeley.EDU (Roland McGrath) Newsgroups: comp.unix.wizards Subject: Re: How to write a current directory finder? Message-ID: Date: 2 Apr 89 18:18:14 GMT References: <1368@auspex.auspex.com> Sender: usenet@agate.BERKELEY.EDU Organization: Hackers Anonymous International, Ltd., Inc. (Applications welcome) Lines: 11 In-reply-to: guy@auspex.auspex.com's message of 2 Apr 89 08:59:11 GMT It did occur to me that looking up five levels of `..' could be quite slow, and perhaps changing directories really would make a significant difference. So I rewrote my function to change directories and stat "" (which past experience tells me is a real quick way to get the current directory with no name lookup). It may have been somewhat faster than before, but it was still orders of magnitude slower the the system `getwd' (Sun Unix 3.2). -- Roland McGrath Free Software Foundation, Inc. roland@wheaties.ai.mit.edu, mit-eddie!wheaties.ai.mit.edu!roland Copyright 1989 Roland McGrath, under the GNU General Public License, version 1.