How to write a current directory finder?

Roland McGrath mcgrath at paris.Berkeley.EDU
Mon Apr 3 04:18:14 AEST 1989


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 at wheaties.ai.mit.edu, mit-eddie!wheaties.ai.mit.edu!roland
Copyright 1989 Roland McGrath, under the GNU General Public License, version 1.



More information about the Comp.unix.wizards mailing list