Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!uakari.primate.wisc.edu!uflorida!mlb.semi.harris.com!thrush.mlb.semi.harris.com!del From: del@thrush.mlb.semi.harris.com (Don Lewis) Newsgroups: comp.unix.questions Subject: Re: /bin/pwd Message-ID: <1990Sep14.225242.10924@mlb.semi.harris.com> Date: 14 Sep 90 22:52:42 GMT References: <13851@smoke.BRL.MIL> <2497@idunno.Princeton.EDU> <13858@smoke.BRL.MIL> Sender: news@mlb.semi.harris.com Organization: Harris Semiconductor, Melbourne FL Lines: 20 In article <13858@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >In article <2497@idunno.Princeton.EDU> pfalstad@phoenix.Princeton.EDU (Paul John Falstad) writes: >-In article <13851@smoke.BRL.MIL> gwyn@smoke.BRL.MIL (Doug Gwyn) writes: >->No, on most systems there is no easier way than the obvious one of >->seeing where a succession of ".."s gets you. >-That was what I considered "the easy way." But how do you do that? >-For example, how do you find out the name of "."? You could find out >-its inode, and then check the previous directory to see which name >-matches its inode; but that only works until you get to the root of the >-filesystem your directory is mounted in (I don't mean "/"). What then? Do >-you have to check /etc/mtab? > >Yes, you got it, exactly. This scheme fails badly in the presence if Sun's loopback mounts because the filesystem can be mounted in multiple places. -- Don "Truck" Lewis Harris Semiconductor Internet: del@mlb.semi.harris.com PO Box 883 MS 62A-028 Phone: (407) 729-5205 Melbourne, FL 32901