NFS File identity resolution?

Boyd Roberts boyd at necisa.ho.necisa.oz.au
Mon Mar 18 11:16:14 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"
>

Comparing the file-handles will do the job.  But you have to be sure
that the two files are on the same host.  A byte by byte comparison
will do the trick.  There's an NFS call to take a file-descriptor and
return a file-handle (nfs_getfh(2)).

All those other replies about inode numbers are just bogus.  You need
the inode number, dev and generation number.  All that stuff is bundled
into the file handle.  You don't have to worry about the contents of the
file-handle (the object is an opaque cookie anyway), just that the bits
are the same.

And what the hell is this discussion doing in comp.unix.shell?
comp.unix.misc would be a better choice.  Followups to there.


Boyd Roberts			boyd at necisa.ho.necisa.oz.au

``When the going gets wierd, the weird turn pro...''



More information about the Comp.unix.shell mailing list