Bob Proulx <[email protected]> ha escrit:

> Why did having afile hardlinked to another file change the behavior of
> tar?  Why did having afile's hardlink count greater than 1 cause tar
> to think that afile was a hardlink to afile?

Tar uses a kind of guesswork to decide whether a file is a hard link
to another already archived file.  It keeps a table of device/inode
numbers for each archived file.  When a new file is added to the archive
its device/inode numbers are looked up in this table.  If a matching
entry is found, the file is deemed to be a hard link to that entry.
This algorithm is triggered only if the link count of the file
being added is greater than 1 (well, I'm simplifying a bit, because
in some cases it is compared with 0, but that doesn't matter here).

Regards,
Sergey

Reply via email to