gary on 7 Aug 2012 09:16:14 -0700

[Date Prev] [Date Next] [Thread Prev] [Thread Next] [Date Index] [Thread Index]

Re: [PLUG] UNIX File Equivalence

=> On Tue, Aug 7, 2012 at 11:32 AM,  <> wrote:
=>>    In C, check out the stat() family of system calls. It returns a
=>> "struct
=>> stat", and if the st_dev and st_ino values are the same, the file is
=>> the same.
=> [ ... ]
=> I just tested it on my system and it does work for bind mounts too.
=> Are there any filesystems that don't have inode numbers, or at least
=> which don't consistently make them up?  I don't think I'll need to
=> support this running on FAT32, but it does have to be fairly robust on
=> anything you could run a POSIX system off of.

   I believe any file system will have to give you something in st_ino.
Some POSIXy OSs also have an st_gen field which is used for NFS. If
that is available you need to add it as a uniqueness field.

                                  Gary Duzan

Philadelphia Linux Users Group         --
Announcements -
General Discussion  --