Xref: utzoo comp.unix.questions:11982 comp.unix.xenix:5184 Path: utzoo!utgpu!jarvis.csri.toronto.edu!mailrus!tut.cis.ohio-state.edu!ucbvax!decwrl!sun!pitstop!sundc!seismo!uunet!ispi!jbayer From: jbayer@ispi.UUCP (Jonathan Bayer) Newsgroups: comp.unix.questions,comp.unix.xenix Subject: Re: How to determine file being redirected to in C Keywords: redirection Message-ID: <478@ispi.UUCP> Date: 2 Mar 89 13:15:20 GMT References: <10@sherpa.UUCP> <475@ispi.UUCP> <1105@auspex.UUCP> Reply-To: jbayer@ispi.UUCP (Jonathan Bayer) Distribution: na Organization: Intelligent Software Products, Inc. Lines: 22 In article <1105@auspex.UUCP> guy@auspex.UUCP (Guy Harris) writes: } } }Use the stat() and fstat() functions, then compare the inode numbers } }in the structure. If they are the same then the two files are identical. } }Wrong. If the inode numbers (st_ino) *AND* the file system IDs (st_dev) }are the same, then the two files are identical. If just the inode }numbers are the same, you can't conclude anything about whether the }files are the same or not. They could have the same inode number but be }on two different file systems; inode numbers are *not* unique across }file systems. I stand corrected. Working on one filesystem for a while tends to make one forget that the inodes can come from multiple filesystems. JB -- Jonathan Bayer Beware: The light at the end of the Intelligent Software Products, Inc. tunnel may be an oncoming dragon 19 Virginia Ave. ...uunet!ispi!jbayer Rockville Centre, NY 11570 (516) 766-2867 jbayer@ispi.UUCP