>>>>> "Bob" == Bob Proulx <[EMAIL PROTECTED]> writes:
Russell> I have run into some issues about what to do in certain
Russell> cases:
Russell> a) what should be the test for "sameness"? It would be nice
Russell> to rely on stat() information, like: mode, owner, group,
Russell> size, mtime. What is a reasonably robust set of things to
Russell> check? I am planning to provide a --pedantic option that
Russell> will also compare data before assuming "sameness", but for
Russell> performance reasons I'd rather that not be the default mode.
Russell> Advice?
Bob> I believe comparing only st_dev and st_ino is sufficient to tell
Bob> if two files are the same.
Thanks for the reply!
I think I was insufficiently complete in my description of the
problem.
In the usual case (at least as I intend to use this), the two files
being compared will be on different filesystems, so just looking at
st_dev and st_ino won't work. Part of the idea here is to make *one*
(and hopefully only one) independent copy of data to guard against
hardware failure or mutation of the linked data. So, what I am
looking for is a predicate that will tell me if two independent copies
of a file are otherwise indistinguishable (as in: `cp -p foo bar').
This desire for an independent copy has some implications for the
symlink problem also.
--
Russell Senior ``The two chiefs turned to each other.
[EMAIL PROTECTED] Bellison uncorked a flood of horrible
profanity, which, translated meant, `This is
extremely unusual.' ''
_______________________________________________
Bug-fileutils mailing list
[EMAIL PROTECTED]
http://mail.gnu.org/mailman/listinfo/bug-fileutils