Paul Eggert <[email protected]> wrote: > >I've read that sentence two or three times, and I'm >afraid I still don't know what it means. Which sort >of underscores that we're in a tricky area here. > >If I understand you correctly, one objection to your >approach is that it's not trivial to determine whether >a file is "an additional hard link with some other >name". For example, after "mkdir d; touch f; ln f d/f; ln >-s . dot", the file names "dot/f" and "f" name the same hard >link, whereas the file names "d/f" and "f" name different >hard links, but this cannot be determined merely by invoking >lstat on "d/f", "f", and "dot/f".
I think the best approach is to add the files and soft/hard links to the tar archive only if exist physically on the filesystem AND if are requested to be added; and exclude duplicates of the same name and type (file, link) even if exist physically (which shouldn't be possible) or if are requested to be added multiple times. The problem may exist when taring from a pipe files that are generated multiple times with the same name but have different checksum.
