Path: utzoo!news-server.csri.toronto.edu!cs.utexas.edu!sdd.hp.com!zaphod.mps.ohio-state.edu!rpi!uupsi!cmcl2!kramden.acf.nyu.edu!brnstnd From: brnstnd@kramden.acf.nyu.edu (Dan Bernstein) Newsgroups: comp.unix.shell Subject: Re: NFS File identity resolution? Message-ID: <20103:Mar1423:16:4291@kramden.acf.nyu.edu> Date: 14 Mar 91 23:16:42 GMT References: <21078@shlump.nac.dec.com> Organization: IR Lines: 23 In article <21078@shlump.nac.dec.com> prakash@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? You cannot, at least not reliably. On a single machine, two files are the same if and only if they have the same device and inode (st_dev and st_ino after stat()). But there are simply no guarantees of this across multiple machines. Even if you could find out that the two files were the same, what would you want to do with the information? NFS doesn't even guarantee that locks on the file will work right. Even if you could find out that two pathnames referred to the same file, and even if you could do something sensible with the file, you wouldn't want to use the names. What if someone moved the file or unmounted and remounted the disks in the meantime? ---Dan