Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!cs.utexas.edu!uunet!pilchuck!amc-gw!thebes!polari!6sigma2 From: 6sigma2@polari.UUCP (Brian Matthews) Newsgroups: comp.unix.programmer Subject: Re: getting the current working directory Message-ID: <3141@polari.UUCP> Date: 12 Jan 91 19:27:30 GMT References: <42380@ut-emx.uucp> <5195@idunno.Princeton.EDU> Distribution: usa Organization: Seattle Online Public Unix (206) 328-4944 Lines: 14 In article <5195@idunno.Princeton.EDU> pfalstad@phoenix.Princeton.EDU (Paul John Falstad) writes: |Here is a version of getwd I wrote for zsh. I'd be interested in what |people think of it. I needed a version that didn't fork(), and was |having problems with the Sun getwd(). [getwd that crawls up the directory tree reading each directory on the way] The problem with this is that it's quite possible to be in a directory which has some ancestors that can't be read. Thus a program calling this getwd must be running setuid root or in a restricted environment (in which case it probably shouldn't need to call getwd) where it knows all ancestors of the current directory are readable. -- Brian L. Matthews 6sigma2@polari.UUCP