Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!wuarchive!udel!haven!uvaarpa!mmdf From: marc@mit.edu Newsgroups: comp.lang.perl Subject: Re: pwd in perl Message-ID: <1990Aug10.205437.21409@uvaarpa.Virginia.EDU> Date: 10 Aug 90 20:54:37 GMT Sender: mmdf@uvaarpa.Virginia.EDU (Uvaarpa Mail System) Reply-To: marc@mit.edu Organization: The Internet Lines: 20 |> Another thing that I don't think has been mentioned, is that you might |> be in a directory whose parent directory you have no access to. In |> this case reading ..'s files until you find . will not work. This is |> why pwd must be setuid root, so that it can do the appropriate checks. If you have no access to the parent, how did you get to where you are now? I think it's a safe assumption that you can read all the directories up to the root. My system makes this assumption; /bin/pwd is not setuid root. I think a lot of programs probably depend on getwd() working. Here, if getwd ()doesn't work, the shell won't even do the right thing. I agree that perl should have a portable getwd() function. I think it's clear that there is no straightforward way to do what needs to be done portably, so each port must figure out what is right. The case of the PC was brought up, and the same issue applies to the Amiga, and any other non-unix box perl is ported to. IMHO, this is a useful enough feature that it should be a builtin. My $0.02. Marc