Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!uunet!brunix!no!jsb From: jsb@no.cs.brown.edu (John Bazik) Newsgroups: comp.lang.perl Subject: Re: pwd in perl Message-ID: <46905@brunix.UUCP> Date: 9 Aug 90 14:59:43 GMT References: <1141@etnibsd.UUCP> Sender: news@brunix.UUCP Reply-To: jsb@no.cs.brown.edu (John Bazik) Organization: Brown Computer Science Dept. Lines: 18 In article <1141@etnibsd.UUCP>, vsh@etnibsd.UUCP (Steve Harris) writes: |> Here is a simple-minded implementation of pwd in perl. [stuff deleted] Yeah, I did that, too. It was significantly faster than `pwd`, but, unfortunately, breaks under SunOS 4.1. The latter has "virtual filesystems" (or whatever they call it), which reside in memory rather than on disk. By default /tmp is one. For some braindead reason, the inode number of /tmp matches that of /. Actually, I suppose if ($dinode == $pinode && $dname eq $pname) { would do it...hmmm. Anyway, I guess the moral is that any algorithm has to anticipate weirdness but a getwd built-in would just always work. John