How to determine file being redirected to in C

Leslie Mikesell les at chinet.chi.il.us
Sun Mar 5 14:48:33 AEST 1989


In article <1111 at auspex.UUCP> guy at auspex.UUCP (Guy Harris) writes:
>>Then you compare st_ino and st_dev in both returned structures.  If both
>>sets match (ie r.st_ino == f.st_ino && r.st_dev == f.st_dev)
>>then they must be the same file.  (Network fans: is this true
>>for remotely-mounted filesystems?)

>It's true of the SunOS NFS implementation, and probably on all NFS
>implementations derived from it.  The AT&T S5R3 RFS implementation looks
>as if it attempts to preserve this property, also. 

Does st_dev become unique for each remote filesystem or does it just
get a bit set to indicate that it is remote?  If the latter case is true
then the test above might falsely indicate that files on two different
remote systems were the same file.  Hmmm, cpio and tar might get confused
also and think the files should be linked - something to consider with the
versions that only store the first copy in the archive (GNUtar, PAX, perhaps
others).

Les Mikesell



More information about the Comp.unix.questions mailing list