NFS File identity resolution?

Kartik Subbarao subbarao at phoenix.Princeton.EDU
Fri Mar 15 02:22:41 AEST 1991


In article <21078 at shlump.nac.dec.com> prakash at aiag.enet.dec.com writes:
>--
>
>Given a set of NFS servers and clients on the same network, and two
>processes A and B on possibly different nodes, which can communicate
>using sockets. How can the two processes determine if a file referred to
>as "/a/b/c/file" by process A is really the file referred to as "/A/B/file"
>by the process B? In other words, on the node of the process A, "/a/c/b"
>could be mounted on X:/server/dir, and on the node of process B, "/A/B"
>could be mounted on X:/server/dir. It is therefore not enough to compare
>the directory parts alone. One must be able to determine which server
>the file is coming from. [Essentially what the define command does, but
>I want to do it from C].

You can stat() both files, and compare the inodes and see if they're the
same. This would only be a problem, I would guess, if the two files had the
exact same inode number but in fact came from two different disks. Of
course, you could do a simple popen() to df, chop out the right field, and 
make sure that they're the same. This would confirm that they were mounted
on the same place.

			-Kartik
		

--
internet# find . -name core -exec cat {} \; |& tee /dev/tty*
subbarao at phoenix.Princeton.EDU -| Internet
kartik at silvertone.Princeton.EDU (NeXT mail)  
SUBBARAO at PUCC.BITNET			          - Bitnet



More information about the Comp.unix.shell mailing list