I am trying to figure out the best way of handling hard
links when backing up and restoring files. I came across this technote:
http://developer.apple.com/technotes/tn/tn1150.html#HardLinks
which has this interesting statement in it:
“The reason for using a separate link reference number, instead of a catalog node ID,
is to allow hard links to be backed up and restored by utilities that are not
specifically aware of hard links. As long as they preserve filenames, Finder
info, and permissions,
then the hard links will be preserved.”
This seemed too easy, so I wrote some code that tests restoring the
filename, finder info, and permissions for a deleted hard link. This didn’t
work. After recreating the file, it was not a hardlink. I ended up with
multiple copies of the data.
Is that statement in the above tech note accurate and I am just doing
something wrong or is there more to restoring hard links?
Thanks