On Fri, Jul 19, 2002 at 08:48:40PM +0100, Ronan Cunniffe wrote:
> Quoting Ronan Waide <waider at waider.ie>:
>> > 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
Maintained by the ILUG website team. The aim of Linux.ie is to
support and help commercial and private users of Linux in Ireland. You can
display ILUG news in your own webpages, read backend
information to find out how. Networking services kindly provided by HEAnet, server kindly donated by
Dell. Linux is a trademark of Linus Torvalds,
used with permission. No penguins were harmed in the production or maintenance
of this highly praised website. Looking for the
Indian Linux Users' Group? Try here. If you've read all this and aren't a lawyer: you should be!