dslreports logo
site
 
    All Forums Hot Topics Gallery
spc

spacer




how-to block ads


Search Topic:
uniqs
2
share rss forum feed

dave
Premium,MVM
join:2000-05-04
not in ohio
kudos:8
Reviews:
·Verizon FiOS
reply to Bill_MI

Re: Why ever use a hard link?

Well, the short answer is that you'd never find any files without hard links.

All files listed in directories have at least one hard link, it's how they're hooked up to names. Some files may have more than one hard link. Directories tend to have at least two links to them: the name in their parent, and '.' in themselves; more if they have child directories: there's a link from every '..' entry.

In other words, hard links are fundamental to file systems (even those file systems that don't support multiple links to one object). Soft links, aka symbolic links, are a higher-level function.

The effective difference between hard links and soft links is that, in the former case, the file cannot be said to be 'in' one place or another. Both links have the same status; the underlying file doesn't go away until there are no more links to it. With soft links, there's a clear difference between the file and the pointer to the file: the pointer can be left dangling.

Each is an appropriate tool in some circumstances.