On Fri, Jul 19, 2002 at 08:48:40PM +0100, Ronan Cunniffe wrote:
> Quoting Ronan Waide :
> 
> > Sure, but soft links would do the same. To be honest, I'm trying to
> > think of a useful use of hard links right now, and I'm a little
> > stumped. There's gotta be some benefit that I'm missing that's
> > immediately obvious to everyone.
> 
> Using Niall's example - single set of files but >1 namespace, and suppose that
> you want to delete some items from the set according to rules applied to the
> namespaces.  With soft links you need an *extra* namespace the others refer to,
> and after filtering the namespaces, you have to do a manual reference count to
> decide what goes and what stays.  With hard links, you just unlink and deletion
> is automatic.Couldn't have put it better myself, but that's not going to stop me trying :-) 
The above situation occurs precisely because of the major functional difference
between symbolic links (AKA soft links, or symlinks to their friends) and hard
links. Two hard links to the same file are exactly equivalent - one is no more
the files "real" directory entry than is the other. OTOH a symlink is a special
thing which is a link to a real file, and when the file linked to is erased, you
end up with a broken symbolic link - you can't have a broken hard link (except
of course in the case of a banjaxed filesystem).
Niall-- 
Irish Linux Users' Group: ilug@linux.ie
http://www.linux.ie/mailman/listinfo/ilug for (un)subscription information.
List maintainer: listmaster@linux.ie
