Path: utzoo!utgpu!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!spool.mu.edu!news.cs.indiana.edu!news.nd.edu!mentor.cc.purdue.edu!purdue!haven!umbc3!umbc5.umbc.edu!cs4213 From: cs4213@umbc5.umbc.edu (cs4213) Newsgroups: comp.unix.misc Subject: ascending above top of file system Message-ID: <5311@umbc3.UMBC.EDU> Date: 7 Mar 91 01:48:51 GMT Sender: newspost@umbc3.UMBC.EDU Reply-To: cs4213@umbc5.umbc.edu (cs4213) Organization: University of Maryland, Baltimore County Lines: 14 Using only system calls in a C program, how can you find out what the name of the current directory is, if you are at the top of a file system?? Normally, you can find the name of the current directory by recording the inode of the current directory, and the inode of the current parent directory, then examing the parent directory to find the name attached to that inode. However, if the current directory is the top of a filesystem, the inode of both the current directory and the parent directory is 2. Because the two numbers are the same, there is no way I can envision of examing the parent directory. I also can find no way of determining the location where the current file system is mounted in the parent file system. Can anyone illuminate me??