ascending above top of file system

cs4213 cs4213 at umbc5.umbc.edu
Thu Mar 7 11:48:51 AEST 1991


	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??



More information about the Comp.unix.misc mailing list